Conversation
Other minor tweaks to forecasting functions that were identified as part of unit testign.
Fixed __init__ in all classes.
Verification applies to relative error functions.
Since naming convention of forecasting performance metrics was changed, the old references to things like sMAPE and smape_loss had to be updated.
Added examples to docstrings. Fixed squared percentage error functions to match formula in sources. Also fixed geometric_mean_relative_squared_error and geometric_mean_relative_absolute_error
Fixed merge after conversion of master branch to main branch
I do agree with that, @mloning, but I feel they are not homogenously exposed - which contributes to interface inhomogenity.
That's indeed an instance of what I mean above.
Also agreed, but properties shouldn't be constructor parameters (it's not something you can choose/set, but an intrinsic property - a static class variable). |
Okay, what changes to do you suggest to make the interface for classes and functions more consistent? Should we do them in this PR or a follow-up PR?
In principle, yes. Not sure if there is a class for every function already @RNKuhns?
I see, I suggest to make the factory methods private for now and change that in a future PR. |
RelativeLoss metric class.
…sktime into new-forecasting-metrics
mloning
left a comment
There was a problem hiding this comment.
One last change from my side!
|
Nice! I have a few comments:
Minor issues:
|
|
@fkiraly thanks for the feedback. I've made most of the changes you've discussed.
I haven't made the update with We could also include the potential inclusion of |
mloning
left a comment
There was a problem hiding this comment.
I'd prefer to merge this now and add additional functionality in separate PRs.
I'm not sure if all functions should accept y_train and y_pred_benchmark, but let's discuss this in a separate issue/PR.
|
@fkiraly any more comments? Otherwise I'll merge this tomorrow :) |
|
Now merged @RNKuhns - thanks again 🎉 👍 |
|
from sktime.performance_metrics.forecasting import smape_loss ImportError: cannot import name 'smape_loss' from 'sktime.performance_metrics.forecasting' (/usr/local/lib/python3.6/dist-packages/sktime/sktime/performance_metrics/forecasting/init.py) |
|
@jerronl |
|
Perhaps we should add deprecation warnings for the old loss functions? |
Reference Issues/PRs
Fixes #671. See discussion on closed PR #672 that this pull request will complete.
What does this implement/fix? Explain your changes.
Adds additional forecasting metrics as discussed in #671.
This is a draft pull request. I need to finish the docstrings (I'm adding examples to docstrings) and also write unit tests but wanted to give you a heads up of the functionality.
The pull request adds new forecasting performance metrics (see list below) that can each work with multivariate series (but default to work with univariate forecasts). Also changes naming conventions to align with scikit-learn (e.g. mean_absoluate_error rather than mae or mae_loss).
The end result would be the following performance metric functions (each with a corresponding class version for scoring):
relative_error,
mean_asymmetric_error,
mean_absolute_scaled_error,
median_absolute_scaled_error,
mean_squared_scaled_error,
median_squared_scaled_error,
mean_absolute_error,
mean_squared_error,
median_absolute_error,
median_squared_error,
mean_absolute_percentage_error,
median_absolute_percentage_error,
mean_squared_percentage_error,
median_squared_percentage_error,
mean_relative_absolute_error,
median_relative_absolute_error,
geometric_mean_relative_absolute_error,
geometric_mean_relative_squared_error
Does your contribution introduce a new dependency? If yes, which one?
None. Pinning Scikit-learn dependency to >= 0.24.* was done separately.
What should a reviewer concentrate their feedback on?
Focus on changes in ./performance_metrics/forecasting/_functions.py and ./performance_metrics/forecasting/_classes.py.
Finishing fixes elsewhere in module where old performance metric names (e.g. sMAPE) are imported.
Any other comments?
PR checklist
For all contributions
For new estimators