Skip to content
Predict.ai

Accuracy & evaluation

Walk-forward validation

Also called rolling origin, time series cross-validation

Walk-forward validation is backtesting that respects time: train on the past, predict the next horizon, slide the origin forward, repeat. You never train on a Wednesday to predict the Tuesday before it.

Random k-fold is the wrong tool. Time has an arrow. Mix the folds and you will ship a model that already saw the 'future.'

You can expand the training window (more history each fold) or slide a fixed window (forget the distant past). Expanding is common. Sliding helps when old regimes poison the fit.

Purge a small gap between train and test if your features are slow to settle (late-arriving sales). Otherwise the last training day leaks into the first test day through a rolling statistic.

History · origin · horizon

Forecast origin and horizonHistory (train)Horizon (the ask)origin
The origin is 'now' for the model. Everything to the right is the horizon you asked for. Grain is how big each tick is — here, weeks.

Read next

Related terms

Try it on your data.

Connect an outcome and its history. Predict.ai finds the drivers, races the models, and keeps the forecast live — in the workspace, over the API, and through agents.