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

Make get_prediction_vs_actual_data() a public method #1553

Merged
merged 3 commits into from Dec 15, 2020

Conversation

christopherbunn
Copy link
Contributor

Made get_prediction_vs_actual_data() a public method, added a check for outlier_threshold, and added it to API documentation.

Resolves #1542

@christopherbunn christopherbunn force-pushed the 1542_get_prediction_vs_actual_data branch from 2a23252 to 9969dd0 Compare December 14, 2020 19:29
@codecov
Copy link

codecov bot commented Dec 14, 2020

Codecov Report

Merging #1553 (8bf755d) into main (61e1a62) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             main    #1553     +/-   ##
=========================================
+ Coverage   100.0%   100.0%   +0.1%     
=========================================
  Files         234      234             
  Lines       16803    16827     +24     
=========================================
+ Hits        16795    16819     +24     
  Misses          8        8             
Impacted Files Coverage Δ
evalml/model_understanding/__init__.py 100.0% <ø> (ø)
evalml/model_understanding/graphs.py 99.7% <100.0%> (+0.1%) ⬆️
...lml/tests/model_understanding_tests/test_graphs.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 61e1a62...8bf755d. Read the comment docs.

Copy link
Contributor

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

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

@christopherbunn I think this is good to merge!

def _get_prediction_vs_actual_data(y_true, y_pred, outlier_threshold):
"""Helper method to help calculate the y_true and y_pred dataframe, with a column for outliers"""
def get_prediction_vs_actual_data(y_true, y_pred, outlier_threshold=None):
"""Combines y_true and y_pred into a single dataframe and adds a column for outliers. Used in `graph_prediction_vs_actual()`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice docstring!

y_true (pd.Series): The real target values of the data
y_pred (pd.Series): The predicted values outputted by the regression model.
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like from impl that woodwork is supported too? Could you update docstr / tests? Otherwise I can wait for this to be merged and add it to a PR of mine too hehe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep I can add it to this PR!

Copy link
Contributor

Choose a reason for hiding this comment

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

Sweet, thank you!!

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 good to me!! Thanks for this 🥳

@christopherbunn
Copy link
Contributor Author

Looks like one of the windows checks threw an internal pytest error. Since the other two windows checks passed and the particular failed test passed after rerunning I think it's a one-off error.

@christopherbunn christopherbunn force-pushed the 1542_get_prediction_vs_actual_data branch from c46fd27 to dd887eb Compare December 14, 2020 22:00
@christopherbunn christopherbunn force-pushed the 1542_get_prediction_vs_actual_data branch from dd887eb to 8bf755d Compare December 15, 2020 14:26
@christopherbunn christopherbunn merged commit 39ce817 into main Dec 15, 2020
1 check passed
@christopherbunn christopherbunn deleted the 1542_get_prediction_vs_actual_data branch December 15, 2020 14:50
Copy link
Collaborator

@dsherry dsherry left a comment

Choose a reason for hiding this comment

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

@christopherbunn this is excellent! 🚀

@dsherry dsherry mentioned this pull request Dec 29, 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.

Make _get_prediction_vs_actual_data public and add to API reference
4 participants