class_docstr: Method of Morris for analyzing blackbox systems.
  If using this please cite the package owners as can be found here: https://github.com/SALib/SALib
  
  Morris, Max D. "Factorial sampling plans for preliminary computational experiments."
  Technometrics 33.2 (1991): 161-174.
docstr: Initializes class.
  
  Args:
      model: model or prediction function of model (predict_proba for classification or predict for regression)
      data: Data used to initialize LIME with.
      feature_names: List of feature names.
      feature_types: List of feature types.
      sampler: A SamplerMixin derrived class that can generate samples from data
      **kwargs: Kwargs that will be sent to SALib.analyze.morris.analyze
docstr_tok: ["Initializes","class",".","Args",":","model",":","model","or","prediction","function","of","model","(","predict_proba","for","classification","or","predict","for","regression",")","data",":","Data","used","to","initialize","LIME","with",".","feature_names",":","List","of","feature","names",".","feature_types",":","List","of","feature","types",".","sampler",":","A","SamplerMixin","derrived","class","that","can","generate","samples","from","data","*","*","kwargs",":","Kwargs","that","will","be","sent","to","SALib.analyze.morris.analyze"]
code: def __init__(
      self,
      model,
      data,
      feature_names=None,
      feature_types=None,
      sampler=None,
      **kwargs,
  ):
      """Initializes class.
  
      Args:
          model: model or prediction function of model (predict_proba for classification or predict for regression)
          data: Data used to initialize LIME with.
          feature_names: List of feature names.
          feature_types: List of feature types.
          sampler: A SamplerMixin derrived class that can generate samples from data
          **kwargs: Kwargs that will be sent to SALib.analyze.morris.analyze
      """
  
      from SALib.analyze import morris
  
      data, n_samples = preclean_X(data, feature_names, feature_types)
  
      predict_fn, n_classes, _ = determine_classes(
          model, data, n_samples
      )
      if 3 <= n_classes:
          raise Exception("multiclass MorrisSensitivity not supported")
      predict_fn = unify_predict_fn(
          predict_fn, data, 1 if n_classes == 2 else -1
      )
  
      data, self.feature_names_in_, self.feature_types_in_ = unify_data(
          data, n_samples, feature_names, feature_types, False, 0
      )
  
      # SALib does not support string categoricals, and np.object_ is slower,
      # so convert to np.float64 until we implement some automatic categorical handling
      # Fortran ordered is faster since we go by columns, so use that
      data = data.astype(np.float64, order="F", copy=False)
  
      if sampler is None:
          sampler = MorrisSampler()
  
      samples = sampler.sample(
          data, self.feature_names_in_, self.feature_types_in_
      )
      problem = _gen_problem_from_data(data, self.feature_names_in_)
      analysis = morris.analyze(
          problem, samples, predict_fn(samples).astype(float), **kwargs
      )
  
      # TODO: see if we can clean up these datatypes to simpler and easier to understand
  
      self.mu_ = analysis["mu"]
      self.mu_star_ = analysis["mu_star"]
      self.sigma_ = analysis["sigma"]
      self.mu_star_conf_ = analysis["mu_star_conf"]
  
      mask = self.mu_star_ > 0
      self.convergence_index_ = np.max(
          np.array(self.mu_star_conf_)[mask]
          / np.array(self.mu_star_)[mask]
      )
  
      unique_val_counts = np.zeros(
          len(self.feature_names_in_), dtype=np.int64
      )
      for col_idx, feature in enumerate(self.feature_names_in_):
          X_col = data[:, col_idx]
          unique_val_counts.itemset(col_idx, len(np.unique(X_col)))
  
      self.unique_val_counts_ = unique_val_counts
  
imports: from ..api.base import ExplainerMixin
  from ..api.templates import FeatureValueExplanation
  from ..utils._explanation import gen_name_from_class, gen_global_selector
  from abc import ABC, abstractmethod
  import numpy
  from ..utils._clean_x import preclean_X
  from ..utils._unify_predict import determine_classes, unify_predict_fn
  from ..utils._unify_data import unify_data
label_desc: Use image node_id 1 to create a new MorrisSensitivity object from inherited base classes: ExplainerMixin with example: obj = MorrisSensitivity(model, data, feature_names, feature_types, sampler)