class_docstr: Kernel SHAP is a method that uses the LIME framework to compute
  Shapley Values. Setting the loss function, weighting kernel and
  regularization terms appropriately in the LIME framework allows
  theoretically obtaining Shapley Values more efficiently than
  directly computing Shapley Values.
  
  More information regarding this method and proof of equivalence
  can be found in the original paper here:
  https://arxiv.org/abs/1705.07874
class_docstr_tok: ["Kernel","SHAP","is","a","method","that","uses","the","LIME","framework","to","compute","Shapley","Values",".","Setting","the","loss","function",",","weighting","kernel","and","regularization","terms","appropriately","in","the","LIME","framework","allows","theoretically","obtaining","Shapley","Values","more","efficiently","than","directly","computing","Shapley","Values",".","More","information","regarding","this","method","and","proof","of","equivalence","can","be","found","in","the","original","paper","here",":","https",":","\/\/arxiv.org\/abs\/1705.07874"]
docstr: Args:
  
      forward_func (Callable): The forward function of the model or
                  any modification of it.
docstr_tok: ["Args",":","forward_func","(","Callable",")",":","The","forward","function","of","the","model","or","any","modification","of","it","."]
code: def __init__(self, forward_func: Callable) -> None:
      r"""
      Args:
  
          forward_func (Callable): The forward function of the model or
                      any modification of it.
      """
      Lime.__init__(
          self,
          forward_func,
          interpretable_model=SkLearnLinearRegression(),
          similarity_func=self.kernel_shap_similarity_kernel,
          perturb_func=self.kernel_shap_perturb_generator,
      )
      self.inf_weight = 1000000.0
  
file_path: captum/captum/attr/_core/kernel_shap.py
imports: from typing import Any, Callable, Generator, Tuple, Union
  import torch
  from captum._utils.models.linear_model import SkLearnLinearRegression
  from captum._utils.typing import BaselineType, TargetType, TensorOrTupleOfTensorsGeneric
  from captum.attr._core.lime import construct_feature_mask, Lime
  from captum.attr._utils.common import _format_input_baseline
  from captum.log import log_usage
  from torch import Tensor
  from torch.distributions.categorical import Categorical
label_desc: Use image node_id 1 to create a new KernelShap object from inherited base classes: Lime with example: obj = KernelShap(forward_func)