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
feat: add support for AdaBoostClassifier #3319
base: master
Are you sure you want to change the base?
Conversation
Hi @Helias , thanks for the PR! We'll get round to reviewing the PR, just a quick response to your question about the dependencies. You may read our CONTRIBUTING guide here: https://github.com/shap/shap/blob/master/CONTRIBUTING.md#installing-from-source
|
I read very quickly CONTRIBUTING.md, thanks for the tip. Let me know if I have to update my PR, I hope to add the AdaBoostRegressor when this PR will be merged |
Hi @Helias, it looks like you used the test I provided, which stated that it passes for an ensemble with a single tree. That's why the test has an AdaBoost with one tree, which is basically not an ensemble but a single decision tree. Hence the test passes. Once the AdaBoost ensemble has more than one tree, the test will surely fail. Have you tried a test with multiple trees as well? |
Hi, unfortunately I did not try other tests than your unit test. |
@Helias, if you're using an ensemble with multiple trees, the sum of the SHAP values + expected value will not equal the output of the ensemble. The results are most likely invalid. This is basically what the test is checking and it is an essential for the SHAP algorithm. Could you check this with your use case please? |
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3319 +/- ##
==========================================
+ Coverage 58.13% 58.15% +0.02%
==========================================
Files 89 89
Lines 12540 12547 +7
==========================================
+ Hits 7290 7297 +7
Misses 5250 5250
☔ View full report in Codecov by Sentry. |
@Helias, How many trees are you using? |
I am using the default parameters, so I am using DecisionTreeClassifier initialized with max_depth=1 as estimator. |
Overview
related of #335
after this PR we could close #1219, #1546
Description of the changes proposed in this pull request:
add support for AdaBoostClassifier using this code #1546 (comment)
It worked locally so I think that we can add it to the
shap
repository.I tested it running
pip install git+https://github.com/helias/shap.git@support-adaboost
then I used shap with my AdaBoostClassfiier model.Co-authored-by: tk27182
Co-authored-by: ArkanEmre
Co-authored-by: diarmaidfinnerty
@tk27182 @ArkanEmre @diarmaidfinnerty
Checklist
I tried to run
pytest
but I get this error:so I removed that parameter in the pyproject file to make it run.
P.S. I installed also matplotlib and nose manually, but I would like to suggest adding a
requirements_dev.txt
file as a reference for the tests dependencies.