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

log a warning if binary classifier SHAP tensors do not add up to 0, instead of raising an AssertionError #24

Merged
merged 3 commits into from
Aug 25, 2020

Conversation

j-ittner
Copy link
Member

@j-ittner j-ittner commented Aug 23, 2020

Sequential PR: Please first approve and merge PR #6 before processing this PR.

This resolves #12.

By definition, both SHAP tensors obtained for a binary classifier should add up to 0.0 for each observation and feature.

In practice we have seen evidence of totals up to 0.01 due to imprecisions in the SHAP explainer's approach for estimating SHAP values.

Therefore we will not raise an exception if the totals are not 0.0 but will log a warning instead, stating the range of observed totals. As long as these totals are small (e.g., less than 0.05, corresponding to 5%pt probability), it should be safe to ignore these warnings.

@j-ittner j-ittner added the sequential Sequential pull requests - please merge in order that it was put in if not specified otherwise label Aug 23, 2020
@j-ittner j-ittner self-assigned this Aug 23, 2020
Copy link
Contributor

@jason-bentley jason-bentley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to checks regarding binary classifier shap tensors do not add up to 0 look good. Thanks!

@j-ittner j-ittner merged commit 229d4e4 into develop Aug 25, 2020
@j-ittner j-ittner deleted the bugfix/raw_shap_assertion_for_binary_classification branch August 25, 2020 15:09
@j-ittner j-ittner added this to the 1.0.1 milestone Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sequential Sequential pull requests - please merge in order that it was put in if not specified otherwise
Projects
None yet
2 participants