class_docstr: Explains predictions on Image (i.e. matrix) data.
  For numerical features, perturb them by sampling from a Normal(0,1) and
  doing the inverse operation of mean-centering and scaling, according to the
  means and stds in the training data. For categorical features, perturb by
  sampling according to the training distribution, and making a binary
  feature that is 1 when the value is the same as the instance being
  explained.
class_docstr_tok: ["Explains","predictions","on","Image","(","i.e",".","matrix",")","data",".","For","numerical","features",",","perturb","them","by","sampling","from","a","Normal","(","0,1",")","and","doing","the","inverse","operation","of","mean-centering","and","scaling",",","according","to","the","means","and","stds","in","the","training","data",".","For","categorical","features",",","perturb","by","sampling","according","to","the","training","distribution",",","and","making","a","binary","feature","that","is","1","when","the","value","is","the","same","as","the","instance","being","explained","."]
docstr: Init function.
  
  Args:
      kernel_width: kernel width for the exponential kernel.
      If None, defaults to sqrt(number of columns) * 0.75.
      kernel: similarity kernel that takes euclidean distances and kernel
          width as input and outputs weights in (0,1). If None, defaults to
          an exponential kernel.
      verbose: if true, print local prediction values from linear model
      feature_selection: feature selection method. can be
          'forward_selection', 'lasso_path', 'none' or 'auto'.
          See function 'explain_instance_with_data' in lime_base.py for
          details on what each of the options does.
      random_state: an integer or numpy.RandomState that will be used to
          generate random numbers. If None, the random state will be
          initialized using the internal numpy seed.
docstr_tok: ["Init","function",".","Args",":","kernel_width",":","kernel","width","for","the","exponential","kernel",".","If","None",",","defaults","to","sqrt","(","number","of","columns",")","*","0.75.","kernel",":","similarity","kernel","that","takes","euclidean","distances","and","kernel","width","as","input","and","outputs","weights","in","(","0,1",")",".","If","None",",","defaults","to","an","exponential","kernel",".","verbose",":","if","true",",","print","local","prediction","values","from","linear","model","feature_selection",":","feature","selection","method",".","can","be","'forward_selection","'",",","'lasso_path","'",",","'none","'","or","'auto","'",".","See","function","'explain_instance_with_data","'","in","lime_base.py","for","details","on","what","each","of","the","options","does",".","random_state",":","an","integer","or","numpy.RandomState","that","will","be","used","to","generate","random","numbers",".","If","None",",","the","random","state","will","be","initialized","using","the","internal","numpy","seed","."]
code: def __init__(
      self,
      kernel_width=0.25,
      kernel=None,
      verbose=False,
      feature_selection="auto",
      random_state=None,
  ):
      """Init function.
  
      Args:
          kernel_width: kernel width for the exponential kernel.
          If None, defaults to sqrt(number of columns) * 0.75.
          kernel: similarity kernel that takes euclidean distances and kernel
              width as input and outputs weights in (0,1). If None, defaults to
              an exponential kernel.
          verbose: if true, print local prediction values from linear model
          feature_selection: feature selection method. can be
              'forward_selection', 'lasso_path', 'none' or 'auto'.
              See function 'explain_instance_with_data' in lime_base.py for
              details on what each of the options does.
          random_state: an integer or numpy.RandomState that will be used to
              generate random numbers. If None, the random state will be
              initialized using the internal numpy seed.
      """
      kernel_width = float(kernel_width)
  
      if kernel is None:
  
          def kernel(d, kernel_width):
              return np.sqrt(np.exp(-(d**2) / kernel_width**2))
  
      kernel_fn = partial(kernel, kernel_width=kernel_width)
  
      self.random_state = check_random_state(random_state)
      self.feature_selection = feature_selection
      self.base = lime_base.LimeBase(
          kernel_fn, verbose, random_state=self.random_state
      )
  
file_path: lime/lime/lime_image.py
imports: import copy
  from functools import partial
  import numpy
  import sklearn
  from sklearn.utils import check_random_state
  from skimage.color import gray2rgb
  from tqdm.auto import tqdm
  from .None import lime_base
  from .wrappers.scikit_image import SegmentationAlgorithm
label_desc: Use image node_id 1 to create a new LimeImageExplainer object from inherited base classes: object with example: obj = LimeImageExplainer(kernel_width, kernel, verbose, feature_selection, random_state)