Time Series and Forecasting with Python
Time Series and Forecasting is an advanced-level course of 5 lessons (about 3 h 28 min), with 15 exercises and 15 quiz questions. Prerequisites: Model Evaluation and Validation. Exercises run in the browser, with nothing to install.
- Data science
- Advanced
- 5 lessons
- 3 h 28 min
- 15 exercises
- Exercises run in the browser
The course in brief
This course teaches you to handle dated data, understand its structure (trend, seasonality, stationarity), and produce reliable forecasts. You will build baselines, evaluate your models without data leakage, then use exponential smoothing, ARIMA, and regression on lags with a rigorous backtest.
What you will be able to do
- Prepare a time series with pandas (time index, resample, rolling, lags)
- Decompose a series and diagnose trend, seasonality, and stationarity
- Evaluate a forecast with a time-based split, baselines, and the MAE, RMSE, MAPE, and MASE metrics
- Fit exponential smoothing and ARIMA/SARIMA models
- Build lag features without leakage and run a backtest with TimeSeriesSplit
- Choose a multi-horizon forecasting strategy and justify it
Syllabus: 5 lessons
- Create and index a time series with a DatetimeIndex
- Change frequency with resample and aggregate correctly
- Compute rolling windows and shifts (rolling, shift, diff)
- 02
Trend, Seasonality, and Stationarity
- Decompose a series into trend, seasonality, and residual
- Measure autocorrelation and read an ACF plot
- Understand stationarity and make it more likely through differencing
- 03
Baselines and Forecast Evaluation
- Build reference forecasts (naive, seasonal naive, mean)
- Split the data while respecting time
- Compute and interpret MAE, RMSE, MAPE, and MASE
- 04
Classical Models: Exponential Smoothing and ARIMA
- Understand and implement simple exponential smoothing
- Know the Holt and Holt-Winters extensions (trend, seasonality)
- Read the (p, d, q) orders of an ARIMA and estimate an autoregressive model
- 05
Forecast with Machine Learning and Run a Backtest
- Turn a series into a supervised table (lags, windows, calendar) without data leakage
- Evaluate a model with time-based cross-validation (TimeSeriesSplit, rolling origin)
- Distinguish recursive from direct multi-step forecasting
Lag and calendar featuresBacktestingMulti-horizon strategies
Final project
Forecast a Store's Daily Demand over 4 Weeks
Generate (or load) two years of daily sales with trend, weekly and annual seasonality, public holidays, and a few promotions. Produce a 28-day forecast and defend your choice of model in front of a purchasing manager.
Deliverables
- An exploration notebook: resample, moving averages, STL decomposition, and annotated ACF
- A backtest protocol (TimeSeriesSplit or rolling origin) with at least 4 folds and a 28-day horizon
- A comparison of at least four approaches: seasonal naive, Holt-Winters, SARIMA, and an ML model on lag features
- A table of MAE, RMSE, and MASE per model and an actual vs forecast chart with a prediction interval
- A one-page summary note for business readers: chosen model, expected accuracy, limits
Assessment criteria
- No data leakage in the features or in the split
- Baseline correctly implemented and used as a reference (MASE)
- Model choice justified by the backtest and not by a single split
- Multi-horizon strategy made explicit and consistent with the lags used
- Clarity in communicating the results and uncertainties
Frequently asked questions
What level do I need to take this time series course?
You should be comfortable with Python, pandas, and the basics of machine learning (regression, model evaluation). The DS4 course on model evaluation is the recommended prerequisite.
Should I choose ARIMA or a machine learning model for forecasting?
Neither is best everywhere. ARIMA and exponential smoothing are solid on a single series with little data; ML models on lags shine with many series and explanatory variables. The course shows how to compare them by backtest against a baseline.
What is a backtest in forecasting?
It is a cross-validation that respects time: you train on the past, test on the following period, and repeat over several periods to get a reliable estimate of the error.
Do time series foundation models replace classical methods?
They offer forecasts without training and are worth testing, but they must be evaluated with the same protocol as other models. Baselines and classical models remain essential references.
This course, told for your job
Say what you want to be able to do: “Time Series and Forecasting” takes its place in your path, with examples from your field. The concepts stay those of the course.