Skip to content
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

[DOC] Added Docstring for regression forecasting #2564

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 37 additions & 3 deletions aeon/forecasting/_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ def _fit(self, y, exog=None):

Parameters
----------
X : Time series on which to learn a forecaster
y : np.ndarray
A time series on which to learn a forecaster to predict horizon ahead.
exog : np.ndarray, default=None
Optional exogenous time series data. Included for interface
compatibility but ignored in this estimator.

Returns
-------
Expand All @@ -74,14 +78,44 @@ def _fit(self, y, exog=None):
return self

def _predict(self, y=None, exog=None):
"""Predict values for time series X."""
"""
Predict the next horizon steps ahead.

Parameters
----------
y : np.ndarray, default = None
A time series to predict the next horizon value for. If None,
predict the next horizon value after series seen in fit.
exog : np.ndarray, default=None
Optional exogenous time series data. Included for interface
compatibility but ignored in this estimator.

Returns
-------
np.ndarray
single prediction self.horizon steps ahead of y.
"""
if y is None:
return self.regressor_.predict(self.last_)
last = y[:, -self.window :]
return self.regressor_.predict(last)

def _forecast(self, y, exog=None):
"""Forecast values for time series X.
"""
Forecast the next horizon steps ahead.

Parameters
----------
y : np.ndarray
A time series to predict the next horizon value for.
exog : np.ndarray, default=None
Optional exogenous time series data. Included for interface
compatibility but ignored in this estimator.

Returns
-------
np.ndarray
single prediction self.horizon steps ahead of y.

NOTE: deal with horizons
"""
Expand Down