Time Series Forecasting for AI Systems
السلاسل الزمنية والتنبؤ
Most production AI systems that touch the future — how much stock to reorder, how many agents to staff tomorrow, whether an economic indicator is trending up or about to break — are forecasting problems wearing a different name. This course teaches forecasting as its own discipline: how to read a series’ structure, when a 1970s statistical model is still the right tool, when a gradient-boosted learner earns its complexity, how to validate a forecast without lying to yourself about accuracy, and how to say not just “what will happen” but “how sure are we.”
Three applications recur across the three days, matching where this shows up in national programs and industry: demand planning (a retailer deciding how much stock to hold), workforce projections (a service organization deciding how many staff a shift needs), and economic indicators (a monthly activity index a policy team tracks for early signs of a turn). Every lesson and lab works against the same four synthetic datasets, so the numbers you compute on Day 1 are still on the screen on Day 3.
What you’ll build
By the end of the course you will have backtested and compared forecasts from statsmodels (ARIMA/SARIMA, exponential smoothing), Prophet, sktime, and LightGBM on the same series, and produced prediction intervals you can defend — not just a point forecast with no sense of how wrong it might be.
Outline
| Day | Focus | Lab deliverable |
|---|---|---|
| 1 — Structure & Classical Models | Decomposition (trend/seasonality/residual), ACF/PACF, stationarity and the ADF test, ARIMA/SARIMA, the exponential smoothing family (SES, Holt, Holt-Winters), model selection with AIC/BIC, residual diagnostics with Ljung-Box | A decomposed and stationarity-tested series, plus a fitted ARIMA/ETS model with residuals that pass diagnostics |
| 2 — Machine-Learned Forecasting & Backtesting | Lag/rolling/calendar features and why tree models need them, target transforms, walk-forward validation (expanding vs. rolling windows), leakage pitfalls | A LightGBM forecaster validated with a proper walk-forward backtest, not a single train/test split |
| 3 — Uncertainty, Comparison & Capstone | Prediction intervals, quantile regression and pinball loss, conformal prediction, calibration (coverage + width), a decision framework for choosing a model family | Calibrated prediction intervals across model families, feeding into the capstone’s model comparison |
Runs with no API key
Every lab is a self-bootstrapping Colab notebook. Open it, run the first cell, and it installs what it needs and pulls the course’s datasets straight from this repository’s raw GitHub URLs — no local install, no API key, no account to create. The datasets themselves are synthetic and generated by a script committed in this repo, so nothing here depends on a live data source either.
No LLM, no external API, no paid service anywhere in this course. Every dataset is synthetic and reproducible; every library is free and open source. If your Colab runtime can pip install, it can run every lab.
Get started
Head to Setup to open the first lab, or start reading from Course Overview if you’d rather begin with the material.