Additional Time Series in ETNA

Artem (amaqte)13 May 2022

Problem

A retailer forecasts daily sales per product and knows things the sales history does not show: when promotions run and which holidays fall inside the horizon. A model that sees only past sales cannot explain a demand jump during a promotion or predict the drop when it ends. The forecast comes out smooth and misses short-term swings.

Example from the article: sales of six products over three years, a schedule of 1,000 recurring promotions (1 = running that day, 0 = not), a 28-day forecast scored with SMAPE.

Solution in brief

Treat every series whose future values are known (a promotion schedule, a holiday calendar) as a regressor and give it to the model together with the sales history. In ETNA this is done once, when the dataset is created, and the same pipeline then uses the extra series automatically.

Questions this case answers
  • How to improve a per-series forecast by feeding the model external signals whose future values are already known, when the effect of each signal is unknown
  • How to use a known promotion schedule to make daily sales forecasts more accurate?
  • How to pass future-known external series (regressors) to a forecasting model in ETNA?
  • How to see which promotions or calendar features drive the sales of each product?

Tools and methods

  • ETNA — time-series library; TSDataset holds sales and extra series, with a pipeline and backtest on top
  • CatBoostModelPerSegment — a separate CatBoost gradient boosting model per product series
  • Lag and calendar features — day of week, month, week of month and year, month of year, plus lags
  • Backtest and SMAPE — compare forecasts with and without regressors
  • plot_feature_relevance — model-based feature importance per series
Continue reading — it's free

Google or a one-time email code. No password.