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

Any way to speed up SHAP interaction values? #15

Closed
Chrisjb opened this issue Feb 9, 2021 · 2 comments
Closed

Any way to speed up SHAP interaction values? #15

Chrisjb opened this issue Feb 9, 2021 · 2 comments

Comments

@Chrisjb
Copy link

Chrisjb commented Feb 9, 2021

When computing the interactions for use in dependence plots, we run:

shap_int <- predict(xgb_mod, (X_train), predinteraction = TRUE)

This takes a really, really long time when the xgboost model has lots of variables. Do you know of any way of speeding up the calculation? Perhaps by only letting it consider features with high average importance?

Thanks for the great work

@liuyanguu
Copy link
Owner

liuyanguu commented Feb 10, 2021

I suggest referring to discussions at https://github.com/slundberg/shap and the XGBoost package: https://github.com/dmlc/xgboost
After all we just get the interaction SHAP values from predict.xgb.Booster using predict(xgb_model, (X_train), predinteraction = TRUE)

@Chrisjb
Copy link
Author

Chrisjb commented Feb 10, 2021

Thanks, will do. I ended up building a smaller XGBoost model based on the top n variables from the original - less variables reduces compute time exponentially

@Chrisjb Chrisjb closed this as completed Feb 10, 2021
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