code: def get_explainer(algorithm, X_train):
      explainer = None
      if algorithm.algorithm_short_name in [
          "Xgboost",
          "Decision Tree",
          "Random Forest",
          "LightGBM",
          "Extra Trees",
          "CatBoost",
      ]:
          explainer = shap.TreeExplainer(algorithm.model)
      elif algorithm.algorithm_short_name in ["Linear"]:
          explainer = shap.LinearExplainer(algorithm.model, X_train)
      # elif algorithm.algorithm_short_name in ["Neural Network"]:
      #    explainer = shap.KernelExplainer(algorithm.model.predict, X_train)  # slow
  
      return explainer
  
imports: import logging
  import os
  import matplotlib.pyplot
  import numpy
  import pandas
  import shap
  from sklearn.preprocessing import OneHotEncoder
  from supervised.algorithms.registry import BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, REGRESSION
  from supervised.utils.config import LOG_LEVEL
  import warnings
label_desc: Use image node_id 2 for calling the PlotSHAP obj's underlying member method code with example usage: obj.get_explainer(algorithm, X_train) and returns: explainer