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

Adding the Index ID to explain_prediction_best_worst_output #1365

Merged
merged 4 commits into from
Nov 4, 2020

Conversation

freddyaboulton
Copy link
Contributor

@freddyaboulton freddyaboulton commented Oct 29, 2020

Pull Request Description

Fixes #1119.

FYI @RezaAkhtar


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.

@freddyaboulton freddyaboulton self-assigned this Oct 29, 2020
@codecov
Copy link

codecov bot commented Oct 29, 2020

Codecov Report

Merging #1365 into main will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1365      +/-   ##
==========================================
+ Coverage   99.95%   99.95%   +0.01%     
==========================================
  Files         213      213              
  Lines       13929    13938       +9     
==========================================
+ Hits        13922    13931       +9     
  Misses          7        7              
Impacted Files Coverage Δ
...tanding/prediction_explanations/_user_interface.py 100.00% <100.00%> (ø)
...s/prediction_explanations_tests/test_explainers.py 100.00% <100.00%> (ø)

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 6ed3e37...b2e3cf9. Read the comment docs.

@RezaAkhtar
Copy link

LGTM 🆔

@@ -345,6 +349,7 @@ def test_output_format_checked():
Predicted Value: setosa
Target Value: setosa
Cross Entropy: 0.15
Index ID: {{index_0}}
Copy link
Contributor

Choose a reason for hiding this comment

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

why does this have two curly braces?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We call .format once to format the string with the template for the multiclass shap table (that'll remove the outer curly braces) and then in the test we call .format to format the answer with the expected index (that'll remove the inner curly braces).

Copy link
Contributor

@bchen1116 bchen1116 left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -426,12 +432,23 @@ def test_explain_predictions_best_worst_and_explain_predictions(mock_make_table,
pipeline.problem_type = problem_type
pipeline.name = "Test Pipeline Name"

def _add_custom_index(answer, index_best, index_worst, output_format):
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

@freddyaboulton freddyaboulton force-pushed the 1119-index-id-best-worst branch 2 times, most recently from f121736 to 9ee8ac3 Compare October 30, 2020 20:24
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.

Solid, LGTM! I see the updated docs as well. 🥳
image

@CLAassistant
Copy link

CLAassistant commented Nov 4, 2020

CLA assistant check
All committers have signed the CLA.

@freddyaboulton freddyaboulton merged commit 86a39b0 into main Nov 4, 2020
@freddyaboulton freddyaboulton deleted the 1119-index-id-best-worst branch November 4, 2020 21:28
@dsherry dsherry mentioned this pull request Nov 24, 2020
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: display Index ID for best/worst prediction explanations
6 participants