Problem
An analyst has daily sales for many store-product pairs and needs a forecast a full year ahead. Each pair is its own series, with yearly and weekly seasonality and peaks on holidays. A regression model needs the past of each series as features. A feature whose value is unknown at forecast time leaves the model unable to predict.
Example from the article: the Kaggle Tabular Playground Series, Jan 2022. Daily sales of mugs, stickers and hats in six imaginary stores (two each in Finland, Norway and Sweden), 18 series in total. The task is a one-year forecast scored by symmetric mean absolute percentage error (SMAPE).
Solution in brief
Put every store-product pair into one table as a separate segment and add calendar and lag features. Use only lags at least as long as the forecast horizon. Fit a plain linear regression per segment and judge it by a backtest, not by eye.
Questions this case answers
- How to forecast a long horizon for many parallel time series with a simple regression model and calendar features
- How to choose lag and rolling-statistic features that are known at prediction time for a long forecast horizon
- How to forecast a year of daily sales for many store-product series at once
- How to build lag features that are still available at forecast time when the horizon is 365 days
Tools and methods
- ETNA — T-Bank's open-source forecasting library:
TSDataset, transforms, models,Pipelinewith backtest - Lag and rolling-statistic features — give a regression model information about the past of the series
- Linear regression per segment — one model for each series (
LinearPerSegmentModel) - Backtest — compares the forecast with the last known year and reports SMAPE per series
Google or a one-time email code. No password.
