Time Series Forecasting: Score the Baselines First
Yesterday as the forecast missed by 12.3 a day; the same weekday last week missed by 6.8, and a model only got to 5.4.
Video #192 ยท Machine learning and data science
Steps in the video
Files
- data.py (11 lines)
- forecasts.py (21 lines)
- run.py (28 lines)
Tested with
Python 3.12.15 | numpy==2.5.4, scikit-learn==1.9.1, scipy==1.18.1, joblib==1.6.0, narwhals==2.27.1, threadpoolctl==3.7.0, cloudpickle==3.1.2
What this does not show
Made-up, clean weekly data; one-day-ahead forecasts over one eight-week window; gradient boosting untuned; no classical models.
Sources
- https://otexts.com/fpp3/accuracy.html
- https://otexts.com/fpp3/simple-methods.html
- https://pypi.org/pypi/numpy/json
- https://pypi.org/pypi/scikit-learn/json
- https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.GradientBoostingRegressor.html
- https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.TimeSeriesSplit.html
Learning IT by Example.