-
Notifications
You must be signed in to change notification settings - Fork 208
[ENH] enhance naive forecaster with new strategies #2869
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
base: main
Are you sure you want to change the base?
Conversation
Thank you for contributing to
|
aeon/forecasting/_naive.py
Outdated
Parameters | ||
---------- | ||
strategy : str, default="last" | ||
The forecasting strategy to use. | ||
Options: "last", "mean", "seasonal_last". | ||
seasonal_period : int, default=1 | ||
The seasonal period to use for the "seasonal_last" strategy. | ||
E.g., 12 for monthly data with annual seasonality. | ||
horizon : int, default=1 | ||
The number of time steps ahead to forecast. |
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.
This should be in the class docstring.
aeon/forecasting/_naive.py
Outdated
Strategies: | ||
- "last": predicts the last seen value in training for all horizon steps. | ||
|
||
- "mean": predicts the mean of the training series for all horizon steps. | ||
|
||
- "seasonal_last": predict the last season value seen in the training series. | ||
Returns np.nan if the effective seasonal data is empty. |
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.
Include this in the Parameter documentation instead
aeon/forecasting/_naive.py
Outdated
self._fitted_scalar_value_ = None # For 'last' and 'mean' strategies | ||
self._fitted_last_season_ = np.array([]) # For 'seasonal_last', init as empty |
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.
do this in _fit
ideally
aeon/forecasting/tests/test_naive.py
Outdated
def sample_data(): | ||
"""Pytest fixture for sample time series data.""" | ||
return np.array([10, 20, 30, 40, 50]) |
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.
Don't think this is needed, can just create the array in each test.
Reference Issues/PRs
Fixes #2823.
What does this implement/fix? Explain your changes.
Does your contribution introduce a new dependency? If yes, which one?
No.
Any other comments?
PR checklist
For all contributions
For new estimators and functions
__maintainer__
at the top of relevant files and want to be contacted regarding its maintenance. Unmaintained files may be removed. This is for the full file, and you should not add yourself if you are just making minor changes or do not want to help maintain its contents.For developers with write access