Skip to content

Commit

Permalink
Fix SHAP interaction output shape
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuber21 committed Sep 27, 2023
1 parent 598adb2 commit 336cb94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion daal4py/mb/model_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ def _predict_regression(
)
predict_result = predict_algo.compute(X, self.daal_model_)

if pred_interactions:
if pred_contribs:
return predict_result.prediction.ravel().reshape((-1, X.shape[1] + 1))
elif pred_interactions:
return predict_result.prediction.ravel().reshape(
(-1, X.shape[1] + 1, X.shape[1] + 1)
)
Expand Down

0 comments on commit 336cb94

Please sign in to comment.