Problem
A Magnit ML team had to forecast the weekly growth of the change log of 200+ database services, several years ahead, to plan database infrastructure. The series are non-stationary with no clear seasonality, and contain trend changes, isolated anomalies and abrupt level shifts, so Prophet and ARIMA-like models were ruled out. A plain linear regression on a time trend was worse than a naive forecast on half of four sample series.
Example from the article: on four sample series, linear regression with a trend raised WAPE from 0.24 to 0.59 on one series and from 0.24 to 1.05 on another.
Solution in brief
One Etna pipeline in front of a per-series linear model: remove anomalies with a rolling-median rule, fill the gaps, split each series at PELT change points and pass the segments as one-hot features next to a linear trend. Applied unchanged to 216 series, it beats the naive baseline by 4 percentage points of macro WAPE.
Questions this case answers
- How to forecast many non-stationary series with level shifts and outliers when seasonal models such as Prophet or ARIMA do not fit
- How to make a forecasting pipeline that scales from a handful of series to hundreds without per-series code
- How to forecast hundreds of non-stationary weekly series with anomalies and trend shifts without a loop per series?
- How to clean anomalies out of a series before fitting a regression forecaster?
Tools and methods
- Etna — dataset, transforms, pipelines, metrics, interactive tuning plots
- ruptures (PELT) — change point search
- Median outlier rule — flags points far from a rolling median
- Linear regression per series — takes the trend and segment features
- WAPE — error metric, compared with a naive forecast
Google or a one-time email code. No password.
