-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Support for GradientBoostingClassifier using TreeExplainer #479
Comments
It is because only the log odds prior is supported right now for the GradientBoostingClassifier: https://github.com/slundberg/shap/blob/b9e71b7d71e04d835d5ce6a000a5b7ea211c7d21/shap/explainers/tree.py#L472-L477 In order to support the PriorProbabilityEstimator another elif would need to be added that correctly sets the base_offset (the starting point the tree begin boosting from), and the units of the values in the leaves of the tree. Then a unit test would need to be added that checks that the sum of the SHAP values equals the model output as expected (this catches almost all types of errors). I'll add a help-wanted tag in case anyone wants to work on a PR for this :) |
Okay got it. |
I'm not receiving any errors when trying to use sklearn's GB implementation, is it now correctly supported by any means? :/ Anyway, the package is great! thanks for all the effort! |
Hello! Here is a piece of code I'm using:
Running |
@crankyelephant it is not that straightforward; see the SO thread How to interpret base_value of GBT classifier when using SHAP? |
@slundberg should we close the issue now? |
Indeed no errors when using sklearn's GradientBoostingClassifier with TreeExplainer. |
I can see that |
This issue has been inactive for two years, so it's been automatically marked as 'stale'. We value your input! If this issue is still relevant, please leave a comment below. This will remove the 'stale' label and keep it open. If there's no activity in the next 90 days the issue will be closed. |
I am trying to use the GradientBoostingClassifier using the sklearn library. I wanted to known if its already supported or am I doing any mistake in implementation?
The text was updated successfully, but these errors were encountered: