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

cannot slice shap values like SHAP package #35

Open
chinaidf opened this issue May 31, 2024 · 1 comment
Open

cannot slice shap values like SHAP package #35

chinaidf opened this issue May 31, 2024 · 1 comment

Comments

@chinaidf
Copy link

Hi, I am using fasttreeshap v0.1.6 package to calculate the shap values of my random forest model. It really accelerate the shap value calculation substantially. However, when I tried to produce the scatter or dependence plots, I cannot extract a single column of the shap values (e.g., shap_values[:, 0] or shap_values[:, feature1]). I got an IndexError: index 1 is out of bounds for axis 1 with size 1.

@chinaidf
Copy link
Author

I have re-created the shap Explanation object and I found the base_values array is a 2-dimensional array but the SHAP-generated base_values is a 1-dimensional array. I have squeezed the base_values array and the error is corrected.

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

No branches or pull requests

1 participant