code: def shap_values(self, X):
          
  
          # convert dataframes
          if str(type(X)).endswith("pandas.core.series.Series'>"):
              X = X.values
          elif str(type(X)).endswith("'pandas.core.frame.DataFrame'>"):
              X = X.values
  
          #assert str(type(X)).endswith("'numpy.ndarray'>"), "Unknown instance type: " + str(type(X))
          assert len(X.shape) == 1 or len(X.shape) == 2, "Instance must have 1 or 2 dimensions!"
  
          if self.feature_dependence == "correlation":
              phi = np.matmul(np.matmul(X[:,self.valid_inds], self.avg_proj.T), self.x_transform.T) - self.mean_transformed
              phi = np.matmul(phi, self.avg_proj)
  
              full_phi = np.zeros(((phi.shape[0], self.M)))
              full_phi[:,self.valid_inds] = phi
  
              return full_phi
  
          elif self.feature_dependence == "independent":
              if len(self.coef.shape) == 1:
                  return np.array(X - self.mean) * self.coef
              else:
                  return [np.array(X - self.mean) * self.coef[i] for i in range(self.coef.shape[0])]
docs: Estimate the SHAP values for a set of samples.
  
          Parameters
          ----------
          X : numpy.array or pandas.DataFrame
              A matrix of samples (# samples x # features) on which to explain the model's output.
  
          Returns
          -------
          For models with a single output this returns a matrix of SHAP values
          (# samples x # features). Each row sums to the difference between the model output for that
          sample and the expected value of the model output (which is stored as expected_value
          attribute of the explainer).