How this track works
Ten hands-on sessions, one running series: Lumen, a skincare brand whose website sessions we forecast day by day. You will build the series, then climb the method ladder in real Python - decomposition and baselines, exponential smoothing, ARIMA/SARIMA, Prophet, gradient-boosting, and a look at deep models - then backtest, serve, and monitor it, following one forecast from the analyst's first plot to a monitored production model. Tonight lays the foundation: the data shape, the honest split, and the baseline. A running note: forecasts are uncertain, so we always carry a prediction interval, and we teach the published canon (FPP3, Box-Jenkins, Prophet) honestly.
A series is four things stacked together 6 min live
Strip away the jargon and any time series is a sum of four parts: a trend (the slow drift up or down), seasonality (a pattern that repeats on a fixed period - here, a weekly rhythm), a longer cycle, and noise (the irregular wiggle). Forecasting is the craft of pulling those apart, projecting the ones that persist, and being honest about the one that does not.
LiveFrequency, index, and the gaps that break everything3 min▶
Before any model, the series has to be clean and regular:
- A real datetime index - not strings. pandas needs to know Tuesday follows Monday, so it can resample, shift, and roll.
- One fixed frequency - daily, weekly, hourly. Raw logs are irregular; you
resampleto a grid first. - No silent gaps - a missing day is not a zero. Decide explicitly: fill, interpolate, or flag. A gap treated as zero will wreck seasonality.
Frequency is a modelling choice, not a given. Lumen's raw analytics arrive per-session with timestamps. Forecasting daily sessions means resampling those events to a daily count first. Choose the frequency that matches the decision: daily for staffing, weekly for planning. The wrong frequency hides the very pattern you need.
Self-studyBuild the Lumen series on a datetime index (pandas)2 min read▶
Raw event logs are irregular. A resample turns them into a clean daily series:
That s - a value per day on a datetime index - is the input to every model from here.
Split by time, never at random 5 min live
The single most common forecasting bug is a random train/test split. Time only runs one way: you must train on the past and test on the future. Shuffle the rows and you leak tomorrow into today - your accuracy looks great and collapses in production.
LiveHoldout, and why a single split is only the start3 min▶
A simple time holdout is enough to begin: keep the last N periods as the test set and never look at them while modelling.
- Holdout length = your real horizon. If you forecast 14 days ahead, hold out 14 days and score there.
- One split is noisy. A single holdout can flatter or punish a model by luck. In b8 you will upgrade to rolling-origin backtesting - many splits marched forward through time.
- Never tune on the test set. If you pick a model by peeking at test, you have leaked. Use a validation slice or backtest.
Build the series and split it by time ★ 12 min · everyone builds
Turn Lumen's daily sessions into a clean series and carve off an honest holdout.
Load or build a daily series on a datetime index (use the sample below, or export your own non-confidential daily counts to CSV).
Resample to a fixed daily frequency and confirm there are no missing days.
Split by time: last 14 days as the test set, everything before as train. Print the two date ranges to prove test comes after train.
Plot it. Eyeball the trend and the weekly rhythm before you model anything.
Ship the seasonal-naive baseline ★ 8 min · build your own
Before any clever model, build the baseline it has to beat. For a weekly-seasonal series the honest baseline is seasonal-naive: tomorrow equals the same weekday last week. It is two lines, and on seasonal data it is shockingly hard to beat - which is exactly why you measure against it.
Forecast each future day as the value from 7 days earlier (the last observed same weekday).
Score it on the holdout with MAPE (mean absolute percentage error).
Keep it - in b8 you will measure every model against this line, and in b3 you will watch Holt-Winters leave it behind.
Never skip the baseline. The M-competitions - the field's biggest empirical bake-offs - show again and again that simple methods and their combinations are extremely hard to beat. If your ARIMA or neural net cannot beat seasonal-naive on a backtest (b8), it is not earning its complexity. The baseline is also your fallback when a fancy model breaks in production.
Try it yourself - this week ◐ 30-45 min total
- Build a daily series from a real (non-confidential) export - web sessions, orders, tickets - on a datetime index, and resample to a clean daily frequency.
- Plot it. Name the trend, the seasonal period, and any outliers by eye before modelling.
- Split by time (hold out your real horizon) and ship the seasonal-naive baseline. Record its MAPE.
- Write one sentence: what frequency and horizon does your actual decision need?
- Optional: skim FPP3 chapters 2-3 (Hyndman & Athanasopoulos) - the open textbook this track follows.
Sources covered (cited)
Taught from the forecasting canon and the published empirical evidence. This session covers:
Three questions before you go 🎯 ◐ 90 seconds
1 · What are the building blocks of a time series?
A series is a sum of a slow trend, a repeating seasonality, a longer cycle, and irregular noise. Forecasting separates the persistent signal from the unforecastable noise.
2 · Why must a time series be split by time, not at random?
Time runs one way. Train on the past, test on the future. Shuffling lets the model peek at the future - the accuracy is a mirage.
3 · Why build the seasonal-naive baseline first?
On seasonal data, "same weekday last week" is surprisingly strong. If a complex model cannot beat it on a backtest (b8), it is not earning its complexity.