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

Display original feature values in explain predictions #2759

Merged

Conversation

freddyaboulton
Copy link
Contributor

@freddyaboulton freddyaboulton commented Sep 9, 2021

Pull Request Description

Fixes #1359

Users really wanted us to display the original feature value even when there was a standard scaler, so decided to do this in this sprint because it's a small change.


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 changed the title Display original features Display original feature values in explain predictions Sep 9, 2021
@codecov
Copy link

codecov bot commented Sep 9, 2021

Codecov Report

Merging #2759 (0b52400) into main (6817805) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #2759     +/-   ##
=======================================
+ Coverage   99.8%   99.8%   +0.1%     
=======================================
  Files        301     301             
  Lines      27850   27897     +47     
=======================================
+ Hits       27787   27834     +47     
  Misses        63      63             
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 6817805...0b52400. Read the comment docs.

@freddyaboulton freddyaboulton force-pushed the 1359-display-original-feature-values-pred-explanations branch from dcc6412 to 344d34a Compare September 9, 2021 20:37
@freddyaboulton freddyaboulton marked this pull request as ready for review September 9, 2021 20:57
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.

Looks great, thank you!!

I wasn't expecting you to pick this issue ASAP but this is wonderful 🏃‍♂️😁

for feature_name, feature_value in zip(
explanation["feature_names"], explanation["feature_values"]
):
if feature_name == "lat":
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just confirming that even if our original value is nan, we don't error, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, it'll be displayed in the report like any other feature value!

@rpeck
Copy link

rpeck commented Sep 9, 2021

❤️

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.

We live to serve our users. Thanks for taking the initiative.

@freddyaboulton freddyaboulton force-pushed the 1359-display-original-feature-values-pred-explanations branch from 344d34a to 0b52400 Compare September 10, 2021 13:49
@freddyaboulton freddyaboulton merged commit a7d5105 into main Sep 10, 2021
@freddyaboulton freddyaboulton deleted the 1359-display-original-feature-values-pred-explanations branch September 10, 2021 14:10
@chukarsten chukarsten mentioned this pull request Sep 10, 2021
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.

explain_prediction functions display scaled feature values when pipeline has a standard scaler
4 participants