Time-Series Forecasting & Classical ML
Apply the judgment of an engineer who has shipped forecasting and tabular-ML systems in production for
years and competed where simple methods win. The two non-negotiables: always backtest on the time axis
(never random CV), and always beat a naive baseline. Most "forecasting failures" are leakage or a missing
baseline, not a weak model.
How to use this skill
- Read
time-series-forecasting-guide.md in this directory — the full reference (task taxonomy,
the methods spectrum from ARIMA to foundation models, evaluation/backtesting, production, anti-patterns).
Apply it to the task at hand.
- For concrete patterns to imitate — a rolling-origin backtest, a LightGBM lag-feature forecaster, and
anomaly detection via forecast residuals — read
examples.md.
- Match the surrounding codebase/stack conventions (sktime/statsmodels/Darts/Nixtla/scikit-learn);
apply the correctness rules — time-ordered splits, no leaked future features, calibrated intervals —
regardless of stack.
The essentials (full rationale in time-series-forecasting-guide.md)
- Baseline first, always. Naive (last value) and seasonal-naive (value one season ago) are the bar.
If your model can't beat seasonal-naive on a proper backtest, you don't have a model. MASE scales
error by the in-sample seasonal-naive error — < 1 means you beat it.
- Backtest on the time axis. Rolling-origin / expanding- or sliding-window evaluation, multiple
origins. Never random K-fold on a series — it trains on the future to predict the past (leakage).
- No leaked features. A feature at time
t may use only data available at t. Lags/rollings must be
shifted; target-derived features must respect the forecast cutoff; calendar/holiday features are safe.
- Match method to data, not to hype. Few series + clear seasonality → ETS/ARIMA/Theta. Many related
series + rich covariates → GBDT on lag features (LightGBM/XGBoost) or global deep nets (DeepAR/
N-HiTS/TFT/PatchTST). Cold-start / no history → foundation models (TimesFM/Chronos/Moirai/TimeGPT,
verify current) zero-shot. The M4/M5 competitions showed simple methods + GBDT are brutally hard
to beat.
- GBDT is the tabular workhorse. For structured/forecasting features it usually beats deep nets and
always beats linear on nonlinear interactions. Reach for deep learning when you have many long series,
shared structure, rich covariates, or need probabilistic multivariate output.
- Pick the metric for the decision. MAE (median) vs RMSE (penalizes large errors) vs sMAPE/MASE
for cross-series aggregation. Never MAPE near zero (blows up). For probabilistic forecasts use
pinball/quantile loss and check calibration (do 90% intervals cover ~90%?).
- Intermittent demand needs its own tools (Croston, SBA, ADIDA, or quantile GBDT) — squared-error
models collapse the forecast toward zero.
- Hierarchical/grouped series should reconcile (bottom-up / MinT) so levels sum coherently.
- Anomaly detection is often "forecast + flag the residual": fit a model, score
y − ŷ against a
robust threshold. Also know STL decomposition, Isolation Forest, and autoencoders; see
[[ml-observability-monitoring]] which consumes these for drift.
- Production: prevent training-serving skew with point-in-time feature pipelines (
[[data-engineering-feature-stores]]),
set a retraining cadence to track concept drift ([[ml-observability-monitoring]]), and plan for cold start
and scale (thousands–millions of series → global models).
The ecosystem moves fast (it is 2026) — verify foundation-model names, versions, and benchmark claims
against current docs before relying on them.
Related skills
[[ml-system-design]] — frame the problem→metric→data→model→serving→monitoring loop before modeling.
[[data-engineering-feature-stores]] — point-in-time joins and feature pipelines that prevent leakage/skew.
[[ml-observability-monitoring]] — concept/data drift, retrain triggers; consumes forecast-residual anomalies.
[[ml-evaluation-evals]] — metrics discipline, A/B testing, eval-in-CI for the broader ML picture.
[[recsys-ranking]] — when "forecasting" is really ranking/demand at the item level with strong covariates.
[[graph-ml-gnns]] — relational/spatio-temporal series (traffic, sensor networks) via GNN4TS.
1---2name: time-series-forecasting3description: Time-Series Forecasting & Classical ML4---56# Time-Series Forecasting & Classical ML78Apply the judgment of an engineer who has shipped forecasting and tabular-ML systems in production for9years and competed where simple methods win. The two non-negotiables: **always backtest on the time axis10(never random CV), and always beat a naive baseline.** Most "forecasting failures" are leakage or a missing11baseline, not a weak model.1213## How to use this skill14151. **Read `time-series-forecasting-guide.md`** in this directory — the full reference (task taxonomy,16 the methods spectrum from ARIMA to foundation models, evaluation/backtesting, production, anti-patterns).17 Apply it to the task at hand.182. For concrete patterns to imitate — a rolling-origin backtest, a LightGBM lag-feature forecaster, and19 anomaly detection via forecast residuals — read **`examples.md`**.203. Match the surrounding codebase/stack conventions (sktime/statsmodels/Darts/Nixtla/scikit-learn);21 apply the correctness rules — time-ordered splits, no leaked future features, calibrated intervals —22 regardless of stack.2324## The essentials (full rationale in `time-series-forecasting-guide.md`)2526- **Baseline first, always.** Naive (last value) and seasonal-naive (value one season ago) are the bar.27 If your model can't beat seasonal-naive on a proper backtest, you don't have a model. **MASE** scales28 error by the in-sample seasonal-naive error — < 1 means you beat it.29- **Backtest on the time axis.** Rolling-origin / expanding- or sliding-window evaluation, multiple30 origins. **Never random K-fold** on a series — it trains on the future to predict the past (leakage).31- **No leaked features.** A feature at time `t` may use only data available at `t`. Lags/rollings must be32 shifted; target-derived features must respect the forecast cutoff; calendar/holiday features are safe.33- **Match method to data, not to hype.** Few series + clear seasonality → **ETS/ARIMA/Theta**. Many related34 series + rich covariates → **GBDT on lag features (LightGBM/XGBoost)** or **global deep nets (DeepAR/35 N-HiTS/TFT/PatchTST)**. Cold-start / no history → **foundation models (TimesFM/Chronos/Moirai/TimeGPT,36 verify current)** zero-shot. The **M4/M5 competitions** showed simple methods + GBDT are brutally hard37 to beat.38- **GBDT is the tabular workhorse.** For structured/forecasting features it usually beats deep nets and39 always beats linear on nonlinear interactions. Reach for deep learning when you have many long series,40 shared structure, rich covariates, or need probabilistic multivariate output.41- **Pick the metric for the decision.** MAE (median) vs RMSE (penalizes large errors) vs **sMAPE/MASE**42 for cross-series aggregation. **Never MAPE near zero** (blows up). For probabilistic forecasts use43 **pinball/quantile loss** and check **calibration** (do 90% intervals cover ~90%?).44- **Intermittent demand needs its own tools** (Croston, SBA, ADIDA, or quantile GBDT) — squared-error45 models collapse the forecast toward zero.46- **Hierarchical/grouped series should reconcile** (bottom-up / MinT) so levels sum coherently.47- **Anomaly detection** is often "forecast + flag the residual": fit a model, score `y − ŷ` against a48 robust threshold. Also know **STL decomposition**, **Isolation Forest**, and autoencoders; see49 `[[ml-observability-monitoring]]` which consumes these for drift.50- **Production:** prevent training-serving skew with point-in-time feature pipelines (`[[data-engineering-feature-stores]]`),51 set a retraining cadence to track concept drift (`[[ml-observability-monitoring]]`), and plan for cold start52 and scale (thousands–millions of series → global models).5354The ecosystem moves fast (it is 2026) — **verify foundation-model names, versions, and benchmark claims55against current docs** before relying on them.5657## Related skills58- `[[ml-system-design]]` — frame the problem→metric→data→model→serving→monitoring loop before modeling.59- `[[data-engineering-feature-stores]]` — point-in-time joins and feature pipelines that prevent leakage/skew.60- `[[ml-observability-monitoring]]` — concept/data drift, retrain triggers; consumes forecast-residual anomalies.61- `[[ml-evaluation-evals]]` — metrics discipline, A/B testing, eval-in-CI for the broader ML picture.62- `[[recsys-ranking]]` — when "forecasting" is really ranking/demand at the item level with strong covariates.63- `[[graph-ml-gnns]]` — relational/spatio-temporal series (traffic, sensor networks) via GNN4TS.