Skip to content

Commit

Permalink
reshapes kernel shap output
Browse files Browse the repository at this point in the history
this deals with e.g. PLSRegression
  • Loading branch information
Oege Dijk committed May 9, 2023
1 parent b2d3f07 commit 3f4a9a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion explainerdashboard/explainers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,8 @@ def shap_explainer(self):

def model_predict(data_asarray):
data_asframe = pd.DataFrame(data_asarray, columns=self.columns)
return self.model.predict(data_asframe)
preds = self.model.predict(data_asframe)
return preds.reshape(len(preds))

self._shap_explainer = shap.KernelExplainer(
model_predict,
Expand Down

0 comments on commit 3f4a9a0

Please sign in to comment.