-
Notifications
You must be signed in to change notification settings - Fork 16
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
Shapley Values #52
Comments
Hi @kmedved, Thanks for raising! The reason the outputs don't match up is that the Example:
There's a small subtlety to get correct results when using early stopping:
I hope this helps! Ideally, the above logic should go into the SHAP package to work natively with |
Thank you - this is very helpful. |
As I'm sure you're aware, Shapley values, via the Shap package, are a common way of understanding GBDT model outputs, which is often key for stakeholder buyin.
I'm having some difficulty getting xgboost-distribution to work well with the Shap package. I've put together an example here on Colab. As you can see, while the Shap package will accept the xgboost-distribution model (if you extract the underlying booster), when I compare the predictions generated by xgboost-distribution to the Shapley plots for the individual predictions, they don't align. You can see this in cell 7 of the the Colab notebook above.
I've also put in a comparison with ngboost's functionality. As you can see in the notebook, the ngboost outputs match the Shap plots for the individual predictions.
I don't have a good understanding as to what's driving this. My best guess is that Shap is getting tripped up somewhere with the measures of variance which xgboost-distribution is outputting. Note also that I am using
model.get_booster()
here, since Shap will not accept a nativexgboost-distribution
object (it will accept an ngboost object). Also, if helpful, the Ngboost added support for Shap in the various pull requests mentioned here: stanfordmlgroup/ngboost#5Thanks - any assistance here would be helpful.
The text was updated successfully, but these errors were encountered: