code: def __init__(
      self,
      model,
      preprocessing=None,
      masker=None,
      explainer_args=None,
      explainer_compute_args=None,
  ):
      super(ShapBackend, self).__init__(model, preprocessing)
      self.masker = masker
      self.explainer_args = explainer_args if explainer_args else {}
      self.explainer_compute_args = (
          explainer_compute_args if explainer_compute_args else {}
      )
  
      if self.explainer_args:
          if "explainer" in self.explainer_args.keys():
              shap_parameters = {
                  k: v
                  for k, v in self.explainer_args.items()
                  if k != "explainer"
              }
              self.explainer = self.explainer_args["explainer"](
                  **shap_parameters
              )
          else:
              self.explainer = shap.Explainer(**self.explainer_args)
      else:
          if shap.explainers.Linear.supports_model_with_masker(
              model, self.masker
          ):
              self.explainer = shap.Explainer(
                  model=model, masker=self.masker
              )
          elif shap.explainers.Tree.supports_model_with_masker(
              model, None
          ):
              self.explainer = shap.Explainer(model=model)
          elif shap.explainers.Additive.supports_model_with_masker(
              model, self.masker
          ):
              self.explainer = shap.Explainer(
                  model=model, masker=self.masker
              )
          # otherwise use a model agnostic method
          elif hasattr(model, "predict_proba"):
              self.explainer = shap.Explainer(
                  model=model.predict_proba, masker=self.masker
              )
          elif hasattr(model, "predict"):
              self.explainer = shap.Explainer(
                  model=model.predict, masker=self.masker
              )
          # if we get here then we don't know how to handle what was given to us
          else:
              raise ValueError(
                  "The model is not recognized by Shapash! Model: "
                  + str(model)
              )
  
file_path: shapash/shapash/backend/shap_backend.py
imports: import pandas
  import numpy
  import shap
  from shapash.backend.base_backend import BaseBackend
label_desc: Use image node_id 1 to create a new ShapBackend object from inherited base classes: BaseBackend with example: obj = ShapBackend(model, preprocessing, masker, explainer_args, explainer_compute_args)