Matthew Lesko
05/07/2024, 7:46 PMfrom statsforecast import StatsForecast
from statsforecast.models import MSTL, AutoARIMA, AutoCES, AutoETS, AutoTheta
season_length = 24
models = [
AutoARIMA(season_length=season_length),
AutoCES(season_length=season_length),
AutoETS(season_length=season_length),
AutoTheta(season_length=season_length),
MSTL(
season_length=[24, 24 * 7], # (24) hours/day, (24 * 7) days/week
trend_forecaster=AutoARIMA(), # model used to forecast trend
alias='MSTL_AutoARIMA'
),
MSTL(
season_length=[24, 24 * 7], # (24) hours/day, (24 * 7) days/week
trend_forecaster=AutoCES(), # model used to forecast trend
alias='MSTL_AutoCES'
),
MSTL(
season_length=[24, 24 * 7], # (24) hours/day, (24 * 7) days/week
trend_forecaster=AutoTheta(), # model used to forecast trend
alias='MSTL_AutoTheta'
)
]
sf = StatsForecast(
models=models, # model used to fit each time series
freq='H', # frequency of the data
n_jobs=-1
)
import warnings
n_windows = 26
crossvalidation_df = sf.cross_validation(
df=features_melted_df,
h=24*7*4,
step_size=24*7,
n_windows=n_windows,
)
The output I get when I run the above in a Jupyter notebook is confusing in terms of understanding progress.José Morales
05/07/2024, 7:49 PMMatthew Lesko
05/07/2024, 7:50 PMJosé Morales
05/07/2024, 7:50 PMJosé Morales
05/07/2024, 7:51 PMMatthew Lesko
05/07/2024, 7:52 PMMatthew Lesko
05/07/2024, 7:56 PMJosé Morales
05/08/2024, 12:37 AM