Skip to content

Adding custom index support for MAPE #1641

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

Merged
merged 3 commits into from
Jan 5, 2021
Merged

Conversation

freddyaboulton
Copy link
Contributor

Pull Request Description

Fixes #1634


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 force-pushed the 1634-custom-index-mape branch from 70846c4 to e35bdb9 Compare January 4, 2021 22:20
@codecov
Copy link

codecov bot commented Jan 4, 2021

Codecov Report

Merging #1641 (c732925) into main (1bc8982) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             main    #1641     +/-   ##
=========================================
+ Coverage   100.0%   100.0%   +0.1%     
=========================================
  Files         240      240             
  Lines       18255    18263      +8     
=========================================
+ Hits        18247    18255      +8     
  Misses          8        8             
Impacted Files Coverage Δ
evalml/objectives/standard_metrics.py 100.0% <100.0%> (ø)
...lml/tests/objective_tests/test_standard_metrics.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 1bc8982...c732925. Read the comment docs.

@freddyaboulton freddyaboulton marked this pull request as ready for review January 4, 2021 22:47
@freddyaboulton freddyaboulton added the bug Issues tracking problems with existing features. label Jan 4, 2021
Copy link
Contributor

@ParthivNaresh ParthivNaresh 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!

Copy link
Contributor

@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.

🚢 !

y_predicted = y_predicted.values
difference = np.subtract(y_true, y_predicted)
scaled_difference = np.divide(difference, y_true)
return np.abs(scaled_difference).mean() * 100
Copy link
Contributor

Choose a reason for hiding this comment

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

@freddyaboulton very cool!

The call to .values converts to a np type -- is that necessary here, or will the first call to one of the np ufuncs do that conversion for you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I ended up removing the ufuncs cause calling .values is all we need!

@freddyaboulton freddyaboulton force-pushed the 1634-custom-index-mape branch from e35bdb9 to c732925 Compare January 5, 2021 15:53
@freddyaboulton freddyaboulton merged commit ea0b3ad into main Jan 5, 2021
@freddyaboulton freddyaboulton deleted the 1634-custom-index-mape branch January 5, 2021 16:23
@bchen1116 bchen1116 mentioned this pull request Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues tracking problems with existing features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MAPE does not support series with custom indices
4 participants