3.9 KiB
Time Series Forecasting
The aeon.forecasting module provides forecasters for univariate and multivariate series. In aeon 1.x, forecasting was rebuilt on array-native BaseForecaster estimators (replacing the old sktime-style fh API). The module is marked experimental — expect API evolution between releases.
Import paths (aeon 1.4+):
from aeon.forecasting import NaiveForecaster, RegressionForecasterfrom aeon.forecasting.stats import ARIMA, AutoARIMA, ETS, AutoETS, Theta, TAR, AutoTAR, TVPfrom aeon.forecasting.deep_learning import TCNForecaster, DeepARForecaster
List all forecasters: aeon.utils.discovery.all_estimators(type_filter="forecaster").
Naive and Baseline Methods
NaiveForecaster—strategyin"last","mean","seasonal_last"; sethorizonandseasonal_periodin the constructor- Use when: Establishing baselines or simple patterns
Statistical Models
ARIMA/AutoARIMA—p,d,qorders (notorder=(p,d,q)); supports exogenous variables viaexogETS/AutoETS— exponential smoothing (native implementations in aeon 1.4+)Theta— classical Theta methodTAR/AutoTAR— threshold autoregressive models for regime switchingTVP— time-varying parameter (Kalman-style) models
Deep Learning Forecasters
Requires aeon[all_extras] (PyTorch stack):
TCNForecaster— temporal convolutional networkDeepARForecaster— probabilistic RNN forecaster (replaces legacyDeepARNetworknaming)
Regression-Based Forecasting
RegressionForecaster— slidingwindowover history,horizonsteps ahead, any sklearn/aeon regressor
Quick Start
import numpy as np
from aeon.forecasting import NaiveForecaster
from aeon.forecasting.stats import ARIMA, AutoETS
y = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
# Naive — horizon is a constructor argument; predict(y) forecasts from series y
naive = NaiveForecaster(strategy="last", horizon=3)
naive.fit(y)
pred_naive = naive.predict(y)
# ARIMA — one-step by default; multi-step via iterative_forecast
arima = ARIMA(p=1, d=1, q=1)
arima.fit(y)
pred_arima = arima.iterative_forecast(y, prediction_horizon=3)
# Auto model selection
auto_ets = AutoETS(horizon=3)
auto_ets.fit(y)
pred_ets = auto_ets.predict(y)
Forecasting Horizon
In aeon 1.x, set horizon on the estimator (number of steps ahead). predict(y) returns the forecast horizon steps beyond the end of y.
Multi-step strategies:
iterative_forecast(y, prediction_horizon)— reuse one fitted model, feed predictions back (ARIMA, many stats models)direct_forecast(y, prediction_horizon)— refit per horizon (requirescapability:horizontag; e.g.RegressionForecaster)NaiveForecaster— sethorizon>1directly whenstrategysupports it
There is no ForecastingHorizon / fh=[1,2,3] API in aeon 1.x.
Model Selection
- Baseline:
NaiveForecaster(strategy="seasonal_last", seasonal_period=12, horizon=h) - Linear / stationary:
ARIMA,AutoARIMA - Trend + seasonality:
ETS,AutoETS - Regime changes:
TAR,AutoTAR - Complex patterns:
TCNForecaster,RegressionForecasterwith aeon regressors - Probabilistic:
DeepARForecaster
Evaluation Metrics
Use scikit-learn or standard numpy metrics on hold-out forecasts:
from sklearn.metrics import mean_absolute_error, mean_squared_error
mae = mean_absolute_error(y_true, y_pred)
mse = mean_squared_error(y_true, y_pred)
Exogenous Variables
Pass aligned exogenous arrays as exog (not X):
forecaster.fit(y_train, exog=exog_train)
y_pred = forecaster.predict(y_test, exog=exog_test)
Base Classes
BaseForecaster—horizon,axis,fit,predict,forecastDirectForecastingMixin/IterativeForecastingMixin— multi-step helpersBaseDeepForecaster— deep learning forecasters
Extend BaseForecaster for custom forecasters.