Skip to content

Commit

Permalink
fix: 🐛 update the shap importance to handle the ndarray, new dtype ou…
Browse files Browse the repository at this point in the history
…tput in the newest shap version
  • Loading branch information
ThomasBury committed Sep 27, 2024
1 parent e50c1e5 commit f8f90da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/arfs/feature_selection/allrelevant.py
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,8 @@ def _get_shap_imp(estimator, X, y, sample_weight=None, cat_feature=None):
else:
# For single-dimensional or binary classification, calculate the average feature importance directly
shap_imp = np.abs(shap_values).mean(axis=0)
else:
shap_imp = np.abs(shap_values).mean(0)

return shap_imp

Expand Down

0 comments on commit f8f90da

Please sign in to comment.