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

Fix bug where prediction explanations class_name was shown as float for boolean targets #3179

Merged
merged 6 commits into from
Jan 5, 2022

Conversation

freddyaboulton
Copy link
Contributor

Pull Request Description

Fixes #3178


After creating the pull request: in order to pass the release_notes_updated check you will need to update the "Future Release" section of docs/source/release_notes.rst to include this pull request by adding :pr:123.

@codecov
Copy link

codecov bot commented Jan 4, 2022

Codecov Report

Merging #3179 (049499a) into main (1343a56) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #3179     +/-   ##
=======================================
+ Coverage   99.7%   99.7%   +0.1%     
=======================================
  Files        324     324             
  Lines      31232   31248     +16     
=======================================
+ Hits       31128   31144     +16     
  Misses       104     104             
Impacted Files Coverage Δ
...tanding/prediction_explanations/_user_interface.py 100.0% <100.0%> (ø)
...s/prediction_explanations_tests/test_explainers.py 100.0% <100.0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1343a56...049499a. Read the comment docs.

Copy link
Contributor

@jeremyliweishih jeremyliweishih left a comment

Choose a reason for hiding this comment

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

LGTM but left a comment about explicitly asserting that the class_name field is a boolean.

algorithm="shap",
)
if problem_type == ProblemTypes.BINARY:
assert exp["explanations"][0]["explanations"][0]["class_name"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we also explicitly assert that the class name is a boolean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great call! Pushing this up now.

@freddyaboulton freddyaboulton force-pushed the 3178-prediction-explanations-bool-fix branch from 7becd56 to 9ffe18c Compare January 4, 2022 21:20
Copy link
Contributor

@angela97lin angela97lin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for doing this @freddyaboulton 👍

problem_type, fraud_100
):
if problem_type == ProblemTypes.BINARY:
X, y = fraud_100
Copy link
Contributor

Choose a reason for hiding this comment

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

omega-nit-pick but X, y = fraud_100 is a duplicate line for both conditions and can be moved out? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link
Contributor

@chukarsten chukarsten left a comment

Choose a reason for hiding this comment

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

Looks good!

@@ -5,6 +5,7 @@ Release Notes
* Added string support for DataCheckActionCode :pr:`3167`
* Added ``DataCheckActionOption`` class :pr:`3134`
* Fixes
* Fix bug where prediction explanations ``class_name`` was shown as float for boolean targets :pr:`3179`
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Fix -> Fixed

@freddyaboulton freddyaboulton merged commit f3472c2 into main Jan 5, 2022
@freddyaboulton freddyaboulton deleted the 3178-prediction-explanations-bool-fix branch January 5, 2022 16:25
@chukarsten chukarsten mentioned this pull request Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prediction Explanations shows boolean class name as numeric in "class_name" field
5 participants