Skip to content

Adding custom index support for MAPE#1641

Merged
freddyaboulton merged 3 commits into
mainfrom
1634-custom-index-mape
Jan 5, 2021
Merged

Adding custom index support for MAPE#1641
freddyaboulton merged 3 commits into
mainfrom
1634-custom-index-mape

Conversation

@freddyaboulton

Copy link
Copy Markdown
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

codecov Bot commented Jan 4, 2021

Copy link
Copy Markdown

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

@ParthivNaresh ParthivNaresh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@dsherry dsherry left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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