class_docstr: Meant to approximate SHAP values for deep learning models.
  
  This is an enhanced version of the DeepLIFT algorithm (Deep SHAP) where, similar to Kernel SHAP, we
  approximate the conditional expectations of SHAP values using a selection of background samples.
  Lundberg and Lee, NIPS 2017 showed that the per node attribution rules in DeepLIFT (Shrikumar,
  Greenside, and Kundaje, arXiv 2017) can be chosen to approximate Shapley values. By integrating
  over many background samples Deep estimates approximate SHAP values such that they sum
  up to the difference between the expected model output on the passed background samples and the
  current model output (f(x) - E[f(x)]).
  
  Examples
  --------
  See :ref:`Deep Explainer Examples <deep_explainer_examples>`
docstr: Return approximate SHAP values for the model applied to the data given by X.
  
  Parameters
  ----------
  X : list,
      if framework == 'tensorflow': numpy.array, or pandas.DataFrame
      if framework == 'pytorch': torch.tensor
      A tensor (or list of tensors) of samples (where X.shape[0] == # samples) on which to
      explain the model's output.
  
  ranked_outputs : None or int
      If ranked_outputs is None then we explain all the outputs in a multi-output model. If
      ranked_outputs is a positive integer then we only explain that many of the top model
      outputs (where "top" is determined by output_rank_order). Note that this causes a pair
      of values to be returned (shap_values, indexes), where shap_values is a list of numpy
      arrays for each of the output ranks, and indexes is a matrix that indicates for each sample
      which output indexes were choses as "top".
  
  output_rank_order : "max", "min", or "max_abs"
      How to order the model outputs when using ranked_outputs, either by maximum, minimum, or
      maximum absolute value.
  
  Returns
  -------
  array or list
      For a models with a single output this returns a tensor of SHAP values with the same shape
      as X. For a model with multiple outputs this returns a list of SHAP value tensors, each of
      which are the same shape as X. If ranked_outputs is None then this list of tensors matches
      the number of model outputs. If ranked_outputs is a positive integer a pair is returned
      (shap_values, indexes), where shap_values is a list of tensors with a length of
      ranked_outputs, and indexes is a matrix that indicates for each sample which output indexes
      were chosen as "top".
docstr_tok: ["Return","approximate","SHAP","values","for","the","model","applied","to","the","data","given","by","X.","Parameters","--","--","--","--","--","X",":","list",",","if","framework","==","'tensorflow","'",":","numpy.array",",","or","pandas.DataFrame","if","framework","==","'pytorch","'",":","torch.tensor","A","tensor","(","or","list","of","tensors",")","of","samples","(","where","X.shape","[","0","]","==","#","samples",")","on","which","to","explain","the","model","'s","output",".","ranked_outputs",":","None","or","int","If","ranked_outputs","is","None","then","we","explain","all","the","outputs","in","a","multi-output","model",".","If","ranked_outputs","is","a","positive","integer","then","we","only","explain","that","many","of","the","top","model","outputs","(","where","``","top","''","is","determined","by","output_rank_order",")",".","Note","that","this","causes","a","pair","of","values","to","be","returned","(","shap_values",",","indexes",")",",","where","shap_values","is","a","list","of","numpy","arrays","for","each","of","the","output","ranks",",","and","indexes","is","a","matrix","that","indicates","for","each","sample","which","output","indexes","were","choses","as","``","top","''",".","output_rank_order",":","``","max","''",",","``","min","''",",","or","``","max_abs","''","How","to","order","the","model","outputs","when","using","ranked_outputs",",","either","by","maximum",",","minimum",",","or","maximum","absolute","value",".","Returns","--","--","--","-","array","or","list","For","a","models","with","a","single","output","this","returns","a","tensor","of","SHAP","values","with","the","same","shape","as","X",".","For","a","model","with","multiple","outputs","this","returns","a","list","of","SHAP","value","tensors",",","each","of","which","are","the","same","shape","as","X",".","If","ranked_outputs","is","None","then","this","list","of","tensors","matches","the","number","of","model","outputs",".","If","ranked_outputs","is","a","positive","integer","a","pair","is","returned","(","shap_values",",","indexes",")",",","where","shap_values","is","a","list","of","tensors","with","a","length","of","ranked_outputs",",","and","indexes","is","a","matrix","that","indicates","for","each","sample","which","output","indexes","were","chosen","as","``","top","''","."]
code: def shap_values(
      self,
      X,
      ranked_outputs=None,
      output_rank_order="max",
      check_additivity=True,
  ):
      """Return approximate SHAP values for the model applied to the data given by X.
  
      Parameters
      ----------
      X : list,
          if framework == 'tensorflow': numpy.array, or pandas.DataFrame
          if framework == 'pytorch': torch.tensor
          A tensor (or list of tensors) of samples (where X.shape[0] == # samples) on which to
          explain the model's output.
  
      ranked_outputs : None or int
          If ranked_outputs is None then we explain all the outputs in a multi-output model. If
          ranked_outputs is a positive integer then we only explain that many of the top model
          outputs (where "top" is determined by output_rank_order). Note that this causes a pair
          of values to be returned (shap_values, indexes), where shap_values is a list of numpy
          arrays for each of the output ranks, and indexes is a matrix that indicates for each sample
          which output indexes were choses as "top".
  
      output_rank_order : "max", "min", or "max_abs"
          How to order the model outputs when using ranked_outputs, either by maximum, minimum, or
          maximum absolute value.
  
      Returns
      -------
      array or list
          For a models with a single output this returns a tensor of SHAP values with the same shape
          as X. For a model with multiple outputs this returns a list of SHAP value tensors, each of
          which are the same shape as X. If ranked_outputs is None then this list of tensors matches
          the number of model outputs. If ranked_outputs is a positive integer a pair is returned
          (shap_values, indexes), where shap_values is a list of tensors with a length of
          ranked_outputs, and indexes is a matrix that indicates for each sample which output indexes
          were chosen as "top".
      """
      return self.explainer.shap_values(
          X,
          ranked_outputs,
          output_rank_order,
          check_additivity=check_additivity,
      )
  
imports: from .._explainer import Explainer
  from .deep_pytorch import PyTorchDeep
  from .deep_tf import TFDeep
label_desc: Use image node_id 2 for calling the DeepExplainer obj's underlying member method code with example usage: obj.shap_values(X, ranked_outputs, output_rank_order, check_additivity) and returns: self