Skip to content
Preptima
mediumConceptScenarioEntryMidSeniorStaff

Why does a random train-test split ruin a forecasting model?

A random train-test split ruins a forecasting model by leaking future observations into training. Use time-based holdouts or rolling-origin backtesting, and build every feature only from data available before the forecast timestamp. Use this time series answer to show the decision, trade-off, and evidence rather than a memorised definition.

5 min readUpdated 2026-08-15

Answer

Short answer

A random split is wrong for forecasting because it lets the model train on future periods and validate on past periods, turning prediction into interpolation. Use a time-based split or rolling-origin backtest: train only on data before the cutoff, forecast the next horizon, score it, then roll the cutoff forward.

Was this answer helpful?

Likely follow-ups

  • Should the training window expand or slide as the origin rolls forward, and when does it matter?
  • You have a target-encoded promotion flag. How do you compute it without lookahead?
  • How do you choose the number of origins and the size of each test window?
  • Your feature is available in the warehouse at 06:00 but describes yesterday. Is that safe?

Related questions

Further reading