code: def shap_local(self, row_number):
      if is_classification(self.model):
          explainer, pred, pred_prob = self.shap_explainer()
  
      else:
          explainer, pred = self.shap_explainer()
  
      if row_number > len(self.input_data):
          raise IndexError(
              f"index {row_number} is out of bounds for axis 0 with size {len(self.input_data)}"
          )
      else:
          if type(explainer) == shap.explainers._tree.Tree:
              local_shap_values = explainer.shap_values(
                  self.input_data.iloc[row_number, :]
              )
              row_with_shap = self.append_shap_values_to_df(
                  input_sv=local_shap_values,
                  in_data=self.input_data.iloc[row_number, :].copy(),
                  scope="local",
              )
  
              row_with_shap["Model Decision"] = pred(
                  pd.DataFrame(self.input_data.iloc[row_number]).T
              )[0]
              row_with_shap["True Values"] = pd.DataFrame(
                  self.actual_data
              ).iloc[row_number][0]
  
              if is_classification(self.model):
                  probabilities = pred_prob(
                      [np.array(self.input_data)[row_number]]
                  )
                  for i in range(len(np.unique(self.actual_data))):
                      row_with_shap[
                          "Probability: {}".format(
                              np.unique(self.actual_data)[i]
                          )
                      ] = probabilities[:, i][0]
  
              return explainer, local_shap_values, row_with_shap
          else:
              local_shap_values = explainer.shap_values(
                  self.input_data.iloc[row_number, :]
              )
              row_with_shap = self.append_shap_values_to_df(
                  input_sv=local_shap_values,
                  in_data=self.input_data.iloc[row_number, :].copy(),
                  scope="local",
              )
  
              row_with_shap["Model Decision"] = pred(
                  pd.DataFrame(self.input_data.iloc[row_number]).T
              )[0]
              row_with_shap["True Values"] = pd.DataFrame(
                  self.actual_data
              ).iloc[row_number][0]
  
              if is_classification(self.model):
                  probabilities = pred_prob(
                      pd.DataFrame(self.input_data.iloc[row_number]).T
                  )
                  for i in range(len(np.unique(self.actual_data))):
                      row_with_shap[
                          "Probability: {}".format(
                              np.unique(self.actual_data)[i]
                          )
                      ] = probabilities[:, i][0]
  
              return explainer, local_shap_values, row_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 9 for calling the ShapleyValues obj's underlying member method code with example usage: obj.shap_local(row_number) and returns: explainer,  local_shap_values,  row_with_shap, explainer,  local_shap_values,  row_with_shap