We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When calculating the interaction values for the RandomForestClassifier one runs into an AttributeError.
RandomForestClassifier
AttributeError
import shap from sklearn.ensemble import RandomForestClassifier from shap.explainers import TreeExplainer X, y = shap.datasets.adult(n_points=50) rfc = RandomForestClassifier(max_depth=1).fit(X, y) ex_rfc = TreeExplainer(rfc) e_rfc = ex_rfc(X, interactions=True)
Traceback (most recent call last): File "/home/tobias/programming/github/shap/bugs/bug_report.py", line 16, in <module> e_rfc = ex_rfc(X, interactions=True) File "/home/tobias/programming/github/shap/shap/explainers/_tree.py", line 244, in __call__ ev_tiled = np.tile(self.expected_value, (v.shape[0], 1)) AttributeError: 'list' object has no attribute 'shape'
Output should be consistent with output of XGBoost, CatBoost, etc. See this issue for further discussion on consistency.
shap-0.43.0
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Issue Description
When calculating the interaction values for the
RandomForestClassifier
one runs into anAttributeError
.Minimal Reproducible Example
Traceback
Expected Behavior
Output should be consistent with output of XGBoost, CatBoost, etc. See this issue for further discussion on consistency.
Bug report checklist
Installed Versions
shap-0.43.0
The text was updated successfully, but these errors were encountered: