Skip to content

Commit

Permalink
[ENH] First PR for forecasting module (#2362)
Browse files Browse the repository at this point in the history
* forecaster base and dummy

* forecasting tests

* forecasting tests

* forecasting tests

* forecasting tests

* regression

* notebook

* regressor

* regressor

* regressor

* tags

* tags

* requires_y

* forecasting notebook

* forecasting notebook

* remove tags

* fix forecasting testing (they still fail though)

* _is_fitted -> is_fitted

* _is_fitted -> is_fitted

* _forecast

* notebook

* is_fitted

* y_fitted

* ETS forecaster

* add y checks and conversion

* add tag

* tidy

* _check_is_fitted()

* _check_is_fitted()

* Add fully functional ETS Forecaster. Modify base to not set default y in forecast. Update tests for ETS Forecaster. Add script to verify ETS Forecaster against statsforecast module using a large number of random parameter inputs. (#2318)

Co-authored-by: Alex Banwell <[email protected]>

* Ajb/forecasting (#2357)

* Add fully functional ETS Forecaster. Modify base to not set default y in forecast. Update tests for ETS Forecaster. Add script to verify ETS Forecaster against statsforecast module using a large number of random parameter inputs.

* Add faster numba version of ETS forecaster

* Seperate out predict code, and add test to test without creating a class - significantly faster!

* Modify _verify_ets.py to allow easy switching between statsforecast versions. This confirms that my algorithms without class overheads is significantly faster than nixtla statsforecast, and with class overheads, it is faster than their current algorithm

* Add basic gradient decent optimization algorithm for smoothing parameters

---------

Co-authored-by: Alex Banwell <[email protected]>

* first forecasters

* beta local

* example

* example

* test regressor

* forecasting notebook

* base

* base

* ETS refactor

* correct test

* private forecast

* remove duplicate

* fit_is_empty check

* fit_is_empty check

* fix changed constant name

* typo

* n_timepoints

* forecasting tests

---------

Co-authored-by: MatthewMiddlehurst <[email protected]>
Co-authored-by: alexbanwell1 <[email protected]>
Co-authored-by: Alex Banwell <[email protected]>
  • Loading branch information
4 people authored Nov 25, 2024
1 parent 993d1d6 commit c835217
Show file tree
Hide file tree
Showing 16 changed files with 1,338 additions and 42 deletions.
13 changes: 13 additions & 0 deletions aeon/forecasting/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"""Forecasters."""

__all__ = [
"DummyForecaster",
"BaseForecaster",
"RegressionForecaster",
"ETSForecaster",
]

from aeon.forecasting._dummy import DummyForecaster
from aeon.forecasting._ets import ETSForecaster
from aeon.forecasting._regression import RegressionForecaster
from aeon.forecasting.base import BaseForecaster
27 changes: 27 additions & 0 deletions aeon/forecasting/_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""DummyForecaster always predicts the last value seen in training."""

from aeon.forecasting.base import BaseForecaster


class DummyForecaster(BaseForecaster):
"""Dummy forecaster always predicts the last value seen in training."""

def __init__(self):
"""Initialize DummyForecaster."""
self.last_value_ = None
super().__init__(horizon=1, axis=1)

def _fit(self, y, exog=None):
"""Fit dummy forecaster."""
y = y.squeeze()
self.last_value_ = y[-1]
return self

def _predict(self, y=None, exog=None):
"""Predict using dummy forecaster."""
return self.last_value_

def _forecast(self, y, exog=None):
"""Forecast using dummy forecaster."""
y = y.squeeze()
return y[-1]
Loading

0 comments on commit c835217

Please sign in to comment.