code: def global_shap_plotting(self):
      if is_classification(self.model):
          explainer, pred, pred_fcn = self.shap_explainer()
          if type(explainer) == shap.explainers._tree.Tree:
              global_shap_values = explainer.shap_values(
                  self.input_data
              )
              data_with_shap = self.append_shap_values_to_df(
                  input_sv=global_shap_values[0],
                  in_data=self.input_data.copy(),
                  scope="global",
              )
              prediction = pred(self.input_data)
              probabilities = pred_fcn(self.input_data)
  
              data_with_shap["Model Decision"] = prediction
              data_with_shap["True Values"] = self.actual_data
              for i in range(len(np.unique(prediction))):
                  data_with_shap[
                      "Probability: {}".format(np.unique(prediction)[i])
                  ] = probabilities[:, i]
              return explainer, global_shap_values, data_with_shap
          else:
              predictions = pred(shap.sample(self.input_data, 100))
              global_shap_values = explainer.shap_values(
                  shap.sample(self.input_data, 100)
              )
              data_with_shap = self.append_shap_values_to_df(
                  input_sv=global_shap_values[0],
                  in_data=shap.sample(self.input_data, 100).copy(),
                  scope="global",
              )
              prediction = pred(shap.sample(self.input_data, 100))
              probabilities = pred_fcn(
                  shap.sample(self.input_data, 100)
              )
              data_with_shap["Model Decision"] = prediction
              data_with_shap["True Values"] = self.actual_data
              for i in range(len(np.unique(self.actual_data))):
                  data_with_shap[
                      "Probability: {}".format(
                          np.unique(self.actual_data)[i]
                      )
                  ] = probabilities[:, i]
  
              return explainer, global_shap_values, data_with_shap
      else:
          explainer, pred = self.shap_explainer()
          if type(explainer) == shap.explainers._tree.Tree:
              # Complete! Do not change.
              global_shap_values = explainer.shap_values(
                  self.input_data
              )
              data_with_shap = self.append_shap_values_to_df(
                  input_sv=global_shap_values,
                  in_data=self.input_data.copy(),
                  scope="global",
              )
              data_with_shap["Model Decision"] = pred(self.input_data)
              data_with_shap["True Values"] = self.actual_data
              return explainer, global_shap_values, data_with_shap
  
          else:
              global_shap_values = explainer.shap_values(
                  shap.sample(self.input_data, 100)
              )
              predictions = pred(shap.sample(self.input_data, 100))
              data_with_shap = self.append_shap_values_to_df(
                  input_sv=global_shap_values,
                  in_data=shap.sample(self.input_data, 100).copy(),
                  scope="global",
              )
              data_with_shap["Model Decision"] = pred(
                  shap.sample(self.input_data, 100)
              )
              data_with_shap["True Values"] = shap.sample(
                  self.actual_data, 100
              )
              return explainer, global_shap_values, data_with_shap
  
file_path: explainx/lib/frameworks/shapley_values.py
imports: from operator import is_
  import shap
  from explainx.lib.utils import is_classification
  import pandas
  import numpy
label_desc: Use image node_id 7 for calling the ShapleyValues obj's underlying member method code with example usage: obj.global_shap_plotting() and returns: explainer,  global_shap_values,  data_with_shap, explainer,  global_shap_values,  data_with_shap, explainer,  global_shap_values,  data_with_shap, explainer,  global_shap_values,  data_with_shap