-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[BUG] MeanAbsoluteError does not leverage horizon_weight #6412
Comments
Can you give an example of a class that does? I was not aware of the argument being used by the classes, and wonder why it is present in the functions and not the classes. |
Metrics class MeanSquaredError does. Example: import numpy as np
from sktime.performance_metrics.forecasting import MeanSquaredError
y_true = np.array([3, -0.5, 2, 7, 2])
y_pred = np.array([2.5, 0.0, 2, 8, 1.25])
mse = MeanSquaredError()
mse(y_true, y_pred) != mse(y_true, y_pred, horizon_weight=np.array([0.1,0.2,0.1,0.3,0.4])) |
Ok, this has puzzled me quite a bit but I now understand what is going on. The Now, we have recently began to improve runtime performance of metrics gradually, and that refactor inadvertently removed this undocumented interface point, namely FYI @sktime/core-developers, this is a textbook example of Hyrum's law 😁 Either way, I think we should be "nice" about this, proposed resolution: weights are actually a nice feature to have for metrics, and it does not cost much to add it to all metrics, and to add it back to the refactored metrics. For compatibility with |
Question out of interest, @kdekker-private, how did you get the idea to use the |
Describe the bug
The performance metric MeanAbsoluteError does not take into account horizon_weight when calling the class instance.
All other scikit-learn based metrics do.
To Reproduce
Expected behavior
The boolean statement at the end should be true.
Additional context
Versions
0.28.0
The text was updated successfully, but these errors were encountered: