-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
SHAP interactions #6058
Comments
Linking some related conversations: |
Here the implementation in {treeshap}: https://github.com/ModelOriented/treeshap/blob/master/src/treeshap.cpp |
@mayer79 |
@kiparkmoon not exactly. Lightgbm and XGBoost contain TreeSHAP as part of the library. XGBoost additionally provides SHAP interactions. It would be fantastic to have SHAP interactions also as part of the lightgbm library. |
@mayer79 I've tried SHAP interaction values for both XGBoost and LightGBM now, and it seems to work SHAP interaction values as long as there are no categorical variables. I pulled out the SHAP interaction value for those. |
In Python, SHAP interactions for lgb are calculated outside the Lightgbm library, namely directly in {shap}. The aim of this issue is to bring it into lightgbm, so that it would also be available outside Python. |
Summary
Scott Lundberg has added SHAP interactions into his TreeSHAP implementation in XGBoost, but not in LightGBM. This option is very helpful in opening the "black box". I'd love to see SHAP interaction values also in LightGBM.
There are a couple of TreeSHAP experts around @hbaniecki that might be willing to implement it directly into LightGBM.
Description
SHAP interactions decompose raw predictions into the sum of contributions from all feature pairs. There is an implementation in C++ in XGBoost (by Scott, I think), and there is the R package {treeshap} https://github.com/ModelOriented/treeshap with another implementation in C++ that also works for LightGBM.
References
Lundberg, S.M., Erion, G., Chen, H. et al. From local explanations to global understanding with explainable AI for trees. Nat Mach Intell 2, 56–67 (2020). https://doi.org/10.1038/s42256-019-0138-9
The text was updated successfully, but these errors were encountered: