class_docstr: Time Series Saliency (TSSaliency) Explainer is a model agnostic saliency explainer
  for time series associate tasks. The TSSaliency supports univariate and multivariate
  use cases. It explains temporal importance of different variates on the model prediction.
  TSSaliency incorporates an integrated gradient method for saliency estimation. The
  saliency measure involves the notion of a base value. For example, the base value can be
  the constant signal with average value. The saliency measure is computed by integrating
  the model sensitivity over a trajectory from the base value to the time series signal. The
  TSSaliency explainer provides variate wise contributions to model prediction at a
  temporal resolution.
  
  References:
      .. [#0] `Mukund Sundararajan et al. "Axiomatic Attribution for Deep Networks"
          <https://arxiv.org/pdf/1703.01365.pdf>`_
docstr: Initializer for TSSaliencyExplainer
  
  Args:
      model (Callable): Callable object produces a prediction as numpy array
          for a given input as numpy array. It can be a model prediction (predict/
          predict_proba) function that results a real value like probability or regressed value.
          This function must accept numpy array of shape (input_length x len(feature_names)) as
          input and result in numpy array of shape (1, -1). Currently, TSSaliency supports sinlge output
          models only. For multi-output models, you can aggregate the output using a custom
          model_wrapper. Use model wrapper classes from aix360.algorithms.tsutils.model_wrappers.
      input_length (int): length of history window used in model training.
      feature_names (List[str]): list of feature names in the input data.
      base_value (List[float]): base value to be used in saliency computation. The
          computed gradients are with respect to this base value. If None, mean value
          is used. Defaults to None.
      n_samples (int): number of path samples to be created for each input instance
          while computing saliency metric. Defaults to 50.
      gradient_samples (int): number of timeseries samples to be generated while
          computing integreated gradient on the input data. Defaults to 25.
      gradient_function (Callable): gradient function to be used in saliency (integrated
          gradient) computation. If None, mc_gradient_compute is used. Defaults to None.
      random_seed (int): random seed to get consistent results. Refer to numpy random state.
          Defaults to 22.
docstr_tok: ["Initializer","for","TSSaliencyExplainer","Args",":","model","(","Callable",")",":","Callable","object","produces","a","prediction","as","numpy","array","for","a","given","input","as","numpy","array",".","It","can","be","a","model","prediction","(","predict\/","predict_proba",")","function","that","results","a","real","value","like","probability","or","regressed","value",".","This","function","must","accept","numpy","array","of","shape","(","input_length","x","len","(","feature_names",")",")","as","input","and","result","in","numpy","array","of","shape","(","1",",","-1",")",".","Currently",",","TSSaliency","supports","sinlge","output","models","only",".","For","multi-output","models",",","you","can","aggregate","the","output","using","a","custom","model_wrapper",".","Use","model","wrapper","classes","from","aix360.algorithms.tsutils.model_wrappers",".","input_length","(","int",")",":","length","of","history","window","used","in","model","training",".","feature_names","(","List","[","str","]",")",":","list","of","feature","names","in","the","input","data",".","base_value","(","List","[","float","]",")",":","base","value","to","be","used","in","saliency","computation",".","The","computed","gradients","are","with","respect","to","this","base","value",".","If","None",",","mean","value","is","used",".","Defaults","to","None",".","n_samples","(","int",")",":","number","of","path","samples","to","be","created","for","each","input","instance","while","computing","saliency","metric",".","Defaults","to","50.","gradient_samples","(","int",")",":","number","of","timeseries","samples","to","be","generated","while","computing","integreated","gradient","on","the","input","data",".","Defaults","to","25.","gradient_function","(","Callable",")",":","gradient","function","to","be","used","in","saliency","(","integrated","gradient",")","computation",".","If","None",",","mc_gradient_compute","is","used",".","Defaults","to","None",".","random_seed","(","int",")",":","random","seed","to","get","consistent","results",".","Refer","to","numpy","random","state",".","Defaults","to","22","."]
code: def __init__(
      self,
      model: Callable,
      input_length: int,
      feature_names: List[str],
      base_value: List[float] = None,
      n_samples: int = 50,
      gradient_samples: int = 25,
      gradient_function: Callable = None,
      random_seed: int = 22,
  ):
      """Initializer for TSSaliencyExplainer
  
      Args:
          model (Callable): Callable object produces a prediction as numpy array
              for a given input as numpy array. It can be a model prediction (predict/
              predict_proba) function that results a real value like probability or regressed value.
              This function must accept numpy array of shape (input_length x len(feature_names)) as
              input and result in numpy array of shape (1, -1). Currently, TSSaliency supports sinlge output
              models only. For multi-output models, you can aggregate the output using a custom
              model_wrapper. Use model wrapper classes from aix360.algorithms.tsutils.model_wrappers.
          input_length (int): length of history window used in model training.
          feature_names (List[str]): list of feature names in the input data.
          base_value (List[float]): base value to be used in saliency computation. The
              computed gradients are with respect to this base value. If None, mean value
              is used. Defaults to None.
          n_samples (int): number of path samples to be created for each input instance
              while computing saliency metric. Defaults to 50.
          gradient_samples (int): number of timeseries samples to be generated while
              computing integreated gradient on the input data. Defaults to 25.
          gradient_function (Callable): gradient function to be used in saliency (integrated
              gradient) computation. If None, mc_gradient_compute is used. Defaults to None.
          random_seed (int): random seed to get consistent results. Refer to numpy random state.
              Defaults to 22.
      """
      super(TSSaliencyExplainer, self).__init__()
      self._model = model
      self._config = dict(
          n_samples=n_samples,
          base_value=base_value,
          gradient_samples=gradient_samples,
          input_length=input_length,
          feature_names=feature_names,
          gradient_function=gradient_function,
          random_seed=random_seed,
      )
      self._is_fitted = True
  
file_path: AIX360/aix360/algorithms/tssaliency/tssaliency.py
imports: import warnings
  import numpy
  from typing import List, Union, Callable
  from aix360.algorithms.tslbbe import TSLocalBBExplainer
  from aix360.algorithms.tssaliency.gradient import mc_gradient_compute
  from aix360.algorithms.tsutils.tsframe import tsFrame, to_np_array
label_desc: Use image node_id 1 to create a new TSSaliencyExplainer object from inherited base classes: TSLocalBBExplainer with example: obj = TSSaliencyExplainer(model, input_length, feature_names, base_value, n_samples, gradient_samples, gradient_function, random_seed)