Skip to content
New issue

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

Error when running experiment that uses SHAP tree explainer #342

Closed
hjwilli opened this issue Sep 8, 2021 · 0 comments · Fixed by #343
Closed

Error when running experiment that uses SHAP tree explainer #342

hjwilli opened this issue Sep 8, 2021 · 0 comments · Fixed by #343
Assignees

Comments

@hjwilli
Copy link
Collaborator

hjwilli commented Sep 8, 2021

Can be reproduced by running experiment classification data set with gradient boosting, decision tree, or random forest classifiers.

Error message:

Traceback (most Recent Call Last): File "driver.py", Line 78, In Main(args, Param Grid) File "driver.py", Line 72, In Main Param Grid=param Grid File "/appsrc/machine/learn/skl Utils.py", Line 445, In Generate Results Target) File "/appsrc/machine/learn/skl Utils.py", Line 741, In Plot Shap Analysis Curve Explainer = Shap.TreeExplainer(model) File "/usr/local/lib/python3.7/site Packages/shap/explainers/ Tree.py", Line 143, In Init Self.model = TreeEnsemble(model, Self.data, Self.data Missing, Model Output) File "/usr/local/lib/python3.7/site Packages/shap/explainers/ Tree.py", Line 759, In Init Self.trees = [SingleTree(e.tree , Scaling=model.learning Rate, Data=data, Data Missing=data Missing) For E In Model.estimators [:,0]] File "/usr/local/lib/python3.7/site Packages/shap/explainers/ Tree.py", Line 759, In Self.trees = [SingleTree(e.tree , Scaling=model.learning Rate, Data=data, Data Missing=data Missing) For E In Model.estimators [:,0]] File "/usr/local/lib/python3.7/site Packages/shap/explainers/ Tree.py", Line 1109, In Init Assert Import("cext") File "/usr/local/lib/python3.7/site Packages/shap/utils/ General.py", Line 23, In Assert Import Raise E File "/usr/local/lib/python3.7/site Packages/shap/explainers/ Tree.py", Line 23, In From .. Import Cext ImportError: Numpy.core.multiarray Failed To Import

Seems to be related to shap/shap#1895

@hjwilli hjwilli self-assigned this Sep 8, 2021
hjwilli added a commit that referenced this issue Sep 8, 2021
@hjwilli hjwilli linked a pull request Sep 9, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant