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

ENHANCEMENT: Handle mono classification with Shap #582

Conversation

degenfabian
Copy link
Contributor

Hi!
This PR intends to address issue #428. For the edge case described in the issue, instead of throwing an error, the program now outputs a warning that the model was only trained on one class and then creates a wrapper model that assigns 1 to said class and 0 to a synthetic class. This way no error is thrown anymore with the example provided in the issue.

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 14.28571% with 12 lines in your changes missing coverage. Please review.

Project coverage is 75.71%. Comparing base (0b5034f) to head (a5f1100).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...n/interpret-core/interpret/utils/_unify_predict.py 14.28% 12 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #582      +/-   ##
===========================================
- Coverage    75.80%   75.71%   -0.10%     
===========================================
  Files           72       72              
  Lines         9081     9095      +14     
===========================================
+ Hits          6884     6886       +2     
- Misses        2197     2209      +12     
Flag Coverage Δ
bdist_linux_310_python 75.38% <14.28%> (-0.10%) ⬇️
bdist_linux_311_python 75.28% <14.28%> (-0.22%) ⬇️
bdist_linux_312_python 75.38% <14.28%> (-0.10%) ⬇️
bdist_linux_39_python 75.14% <14.28%> (-0.31%) ⬇️
bdist_mac_310_python 75.55% <14.28%> (-0.10%) ⬇️
bdist_mac_311_python 75.55% <14.28%> (-0.12%) ⬇️
bdist_mac_312_python 75.45% <14.28%> (-0.20%) ⬇️
bdist_mac_39_python 75.43% <14.28%> (-0.22%) ⬇️
bdist_win_310_python 75.49% <14.28%> (-0.20%) ⬇️
bdist_win_311_python 75.39% <14.28%> (-0.30%) ⬇️
bdist_win_312_python 75.56% <14.28%> (-0.12%) ⬇️
bdist_win_39_python 75.47% <14.28%> (-0.18%) ⬇️
sdist_linux_310_python 75.29% <14.28%> (-0.12%) ⬇️
sdist_linux_311_python 75.12% <14.28%> (-0.26%) ⬇️
sdist_linux_312_python 75.12% <14.28%> (-0.29%) ⬇️
sdist_linux_39_python 75.26% <14.28%> (-0.14%) ⬇️
sdist_mac_310_python 75.40% <14.28%> (-0.08%) ⬇️
sdist_mac_311_python 75.38% <14.28%> (-0.22%) ⬇️
sdist_mac_312_python 75.45% <14.28%> (-0.12%) ⬇️
sdist_mac_39_python 75.35% <14.28%> (-0.20%) ⬇️
sdist_win_310_python 75.56% <14.28%> (-0.10%) ⬇️
sdist_win_311_python 75.49% <14.28%> (-0.22%) ⬇️
sdist_win_312_python 75.51% <14.28%> (-0.18%) ⬇️
sdist_win_39_python 75.44% <14.28%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@paulbkoch
Copy link
Collaborator

Thanks for the fix @degenfabian! Nice to clear this one out too!

@paulbkoch paulbkoch merged commit 90734ec into interpretml:develop Oct 24, 2024
57 checks passed
@degenfabian degenfabian deleted the handle-mono-classification-with-shap branch October 30, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants