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

ExplainerError #18

Closed
hasan-sayeed opened this issue Nov 13, 2022 · 3 comments
Closed

ExplainerError #18

hasan-sayeed opened this issue Nov 13, 2022 · 3 comments

Comments

@hasan-sayeed
Copy link

hasan-sayeed commented Nov 13, 2022

For my dataset I'm getting this error:

ExplainerError: Additivity check failed in TreeExplainer! Please ensure the data matrix you passed to the explainer is the same
shape that the model was trained on. If your data shape is correct then please report this on GitHub. Consider retrying with the 
feature_perturbation='interventional' option. This check failed because for one of the samples the sum of the SHAP values was 
-0.577556, while the model output was -0.540311. If this difference is acceptable you can set check_additivity=False to disable 
this check.

I'm using it like this:

model = BoostRFE(regr_xgb, param_grid=param_dist, 
                               min_features_to_select=10, 
                               step=20, 
                               importance_type='shap_importances',
                               n_iter=5
                               )

Any suggestion how to solve this?

@cerlymarco
Copy link
Owner

Hi, thanks for your feedback.
This error comes from shap. I think a possible cause could be this one.
With the information you reported it's hard to say more. You should clarify more about your X_train/X_valid to have a better view (some data samples to reproduce the error should be perfect)

@hasan-sayeed
Copy link
Author

I am using shap-hypetune for one of my works. How can I cite this?

@cerlymarco
Copy link
Owner

Hi @hasan-sayeed

From my point of view, you can simply cite the project reporting the link and the name of the library

If you support the project don't forget to leave a star ;-)

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

2 participants