-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add MissingCounter
metric
#520
Conversation
@@ -296,4 +296,55 @@ def wape(y_true: ArrayLike, y_pred: ArrayLike, multioutput: str = "joint") -> Ar | |||
return np.sum(np.abs(y_true_array - y_pred_array), axis=axis) / np.sum(np.abs(y_true_array), axis=axis) # type: ignore | |||
|
|||
|
|||
__all__ = ["mae", "mse", "msle", "medae", "r2_score", "mape", "smape", "sign", "max_deviation", "rmse", "wape"] | |||
def count_missing_values(y_true: ArrayLike, y_pred: ArrayLike, multioutput: str = "joint") -> ArrayLike: |
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 haven't added it into etna/metrics/__init__.py
. Do we have to do it?
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 dont think it is needed there.
🚀 Deployed on https://deploy-preview-520--etna-docs.netlify.app |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #520 +/- ##
=======================================
Coverage 90.32% 90.32%
=======================================
Files 256 256
Lines 17199 17214 +15
=======================================
+ Hits 15535 15549 +14
- Misses 1664 1665 +1 ☔ View full report in Codecov by Sentry. |
@@ -296,4 +296,55 @@ def wape(y_true: ArrayLike, y_pred: ArrayLike, multioutput: str = "joint") -> Ar | |||
return np.sum(np.abs(y_true_array - y_pred_array), axis=axis) / np.sum(np.abs(y_true_array), axis=axis) # type: ignore | |||
|
|||
|
|||
__all__ = ["mae", "mse", "msle", "medae", "r2_score", "mape", "smape", "sign", "max_deviation", "rmse", "wape"] | |||
def count_missing_values(y_true: ArrayLike, y_pred: ArrayLike, multioutput: str = "joint") -> ArrayLike: |
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 dont think it is needed there.
@property | ||
def greater_is_better(self) -> None: | ||
"""Whether higher metric value is better.""" | ||
return None |
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.
It is understandable that we can't control missing values in the true target, but shouldn't it be False
? So we prefer more data over the less data.
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 think metrics should be used to compare different methods with each other on the same dataset. This metric will be the same for the same dataset because it doesn't depend on the model.
So, I'm not really sure what value should it have.
"metric", | ||
(MSE(mode="per-segment", missing_mode="ignore"),), | ||
"metric, expected_type", | ||
((MSE(mode="per-segment", missing_mode="ignore"), type(None)), (MissingCounter(mode="per-segment"), float)), |
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.
Maybe NoneType
?
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 is types.NoneType
, but it was added in python 3.10: https://docs.python.org/3/library/types.html#types.NoneType
# Conflicts: # CHANGELOG.md
Before submitting (must do checklist)
Proposed Changes
See #517.
Closing issues
Closes #517.