-
Notifications
You must be signed in to change notification settings - Fork 8
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
Update RMSE, MSLE to handle missing values #542
Conversation
# Conflicts: # etna/metrics/__init__.py # etna/metrics/functional_metrics.py # tests/test_metrics/test_metrics.py
🚀 Deployed on https://deploy-preview-542--etna-docs.netlify.app |
etna/metrics/functional_metrics.py
Outdated
A non-negative floating point value (the best value is 0.0), or an array of floating point values, | ||
one for each individual target. | ||
""" | ||
mse_result = np.asarray(mse(y_true=y_true, y_pred=y_pred, multioutput=multioutput)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you use np.asarray
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid typing errors from mypy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it is ok. In multioutput="joint"
the result should be float, but np.asarray
makes it smth like
np.array([value])
instead of value
.
I thought that we have tests that check that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- We tested that current behavior is ok.
- It could be not so obvious for other readers why do we use
np.asarray
. - Where exactly mypy is raising error? In some other functional metrics we just put
type: ignore
at the last line to ignore the mypy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error: Incompatible return value type (got "ndarray[Any, dtype[Any]]", expected "Union[float, Sequence[float], Sequence[Sequence[float]]]") [return-value]
Got it, I'll try to use type: ignore
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #542 +/- ##
==========================================
- Coverage 90.49% 90.48% -0.01%
==========================================
Files 256 256
Lines 17364 17373 +9
==========================================
+ Hits 15713 15720 +7
- Misses 1651 1653 +2 ☔ View full report in Codecov by Sentry. |
# Conflicts: # CHANGELOG.md
Before submitting (must do checklist)
Proposed Changes
See #526
Closing issues
Closes #526.