code: def calculate_prediction_shap(self, df):
      if self.param["model_name"] == "xgboost":
          import xgboost
  
          if xgboost.__version__ in [
              "1.1.0",
              "1.1.1",
              "1.1.0rc2",
              "1.1.0rc1",
          ]:
              print(
                  "Current Xgboost version is not supported. Please install Xgboost using 'pip install xgboost==1.0.2'"
              )
              return False
          prediction_col = self.param["model"].predict(
              xgboost.DMatrix(df)
          )
  
      elif self.param["model_name"] == "catboost":
          prediction_col = self.param["model"].predict(df.to_numpy())
  
      elif self.param["model_name"] == "h2o":
          df = h2o.H2OFrame(df)
          prediction_col = self.param["model"].predict(df)
  
      else:
          prediction_col = self.param["model"].predict(df.to_numpy())
  
      # is classification?
      is_classification = self.param["is_classification"]
  
      # shap
      c = calculate_shap()
      df_final, explainer = c.find(
          self.param["model"],
          df,
          prediction_col,
          is_classification,
          model_name=self.param["model_name"],
      )
  
      # prediction col
      # df_final["y_prediction"] = prediction_col
  
      if is_classification is True:
          try:
              df_final = self.formatting_y_pred_for_h2o_classification(
                  df_final, prediction_col
              )
              # find and add probabilities in the dataset.
              prediction_col_prob = self.param["model"].predict_proba(
                  df.to_numpy()
              )
          except:
              prediction_col_prob = self.param["model"].predict(df)
              prediction_col_prob = prediction_col_prob.as_data_frame()
          pd_prediction_col_prob = pd.DataFrame(prediction_col_prob)
  
          for c in pd_prediction_col_prob.columns:
              df_final["Probability_" + str(c)] = list(
                  pd_prediction_col_prob[c]
              )
  
          # for c in pd_prediction_col_prob.columns:
          #     df_final["Probability_" + str(c)] = list(pd_prediction_col_prob[c])
          #     if c != 'predict':
          #         if "p" in c:
          #             res = c.split("p")[-1]
          #             df_final["Probability_" + str(res)] = list(pd_prediction_col_prob[c])
          #         else:
          #             df_final["Probability_" + str(c)] = list(pd_prediction_col_prob[c])
          #     else:
          #         df_final["Probability_" + str(c)] = list(pd_prediction_col_prob[c])
          df_final = self.formatting_h2o_prediction_prob(
              df_final, pd_prediction_col_prob
          )
      return df_final
  
imports: from imports import *
  from plotly_graphs import *
  from protodash import *
  from insights import *
  from plotly_css import *
  import pandasql
  import string
  import random
  import os
  from apps import global_explanation, local_explanation, distribution, feature_interaction, cohort
  from app import app
  from what_if import *
  from calculate_shap import *
  from analytics import Analytics
  from cohort_analysis import *
label_desc: Use image node_id 14 for calling the dashboard obj's underlying member method code with example usage: obj.calculate_prediction_shap(df) and returns: df_final, False