Shuffle the months of a year and split them into training and test sets, and a model may deliver a handsome forecast score. But if the task is to forecast July at the end of June, that score does not necessarily answer the real question: is the information available at the time enough to predict an outcome that has not yet happened? Rolling validation takes each evaluation back to a specific forecast origin, putting the training data, the forecast horizon and the arrival time of data on the same timeline.

A rhino researcher in an orange hat arranging calendar cards in time order, separating past months from future months

Figure: organizing historical data by forecast origin. An original hand-drawn illustration by Scholay (AI-assisted).

First Decide When the Forecast Is Made

Suppose an organization needs to forecast next month's number of inquiries at the end of each month. At the end of June it can use the completed statistics for January through June, but not the number of people actually served in July. If July is held out as the test and August is put into training, the evaluation lets the model learn the distribution of future data. That does not match the actual working conditions at the end of June.

Rolling validation moves the forecast origin forward step by step. The first round uses January–June to predict July, the second uses January–July to predict August, and so on. The training data accumulate over time, which is called an expanding window; if only the most recent six months are kept, it is a fixed-length sliding window. Both designs can be valid; the key is consistency with the planned update frequency and the length of history available. Hyndman and Athanasopoulos[1] use this kind of evaluation, moving with the forecast origin, to compare the performance of time series forecasts.

The forecast horizon must be settled at the same time. Accurate next-month forecasts do not mean accurate forecasts for the next three months. If a three-month plan actually has to be issued in one go, each round should evaluate the corresponding three horizons; in the second month you cannot quietly plug in the real value just observed and then treat it as a forecast made three months earlier.

Twelve Months Show Each Round's Comparison

The following constructed series of monthly inquiries demonstrates the calculation: January through December are 100, 105, 103, 110, 112, 115, 117, 116, 122, 124, 123 and 129. Start with a simple baseline: take the month just passed as the forecast for the next month. The purpose of this data is to illustrate the evaluation process; it does not represent the actual records of any organization.

Forecast origin Months available then Forecast month Forecast Actual Absolute error
End of June Jan–Jun July 115 117 2
End of July Jan–Jul August 117 116 1
End of August Jan–Aug September 116 122 6
End of September Jan–Sep October 122 124 2

The mean absolute error over the four rounds is (2 + 1 + 6 + 2) ÷ 4 = 2.75 inquiries. This number describes the one-step forecast error at these four forecast origins. It is neither a training error nor a guarantee of the same performance in another year.

4×12 rolling-validation grid: rows End of Jun/Jul/Aug/Sep train through months 6/7/8/9 and validate on months 7/8/9/10; months 11–12 held out as final test.

Figure 1 | Rolling evaluation layout for the constructed data. Four rows (end of Jun/Jul/Aug/Sep) train through months 6/7/8/9 and validate on months 7/8/9/10; months 11–12 are held out as the final test. Blue = training history; orange = current-round validation; grey = not yet used. The figure was drawn by this example's calculation script.

November and December do not take part in model selection or parameter tuning for now. Once the scheme is fixed, test it under the rule agreed beforehand, “one month ahead, updated every month”: the November forecast is 124 against an actual 123; the December forecast is 123 against an actual 129. The mean absolute error over the final two rounds is 3.5 inquiries. December uses November's real value here because month-end updating was agreed in advance; if the agreement were to forecast the next two months at once at the end of October, a different set of forecasting and scoring rules would have to be written.

Correct Time Order Can Still Leak

Sorting the rows by date solves only part of the problem. Standardization parameters, missing-value imputation values and feature selection results must also be estimated within each round's training set and then applied to that round's validation set. Computing the mean on the full year's data and only then cutting out the first six months still lets the training process touch information from the future. scikit-learn's guide to data leakage[3] recommends putting these steps in the same training pipeline as the model, to avoid carrying test information into fitting.

You also need to distinguish “which day a record corresponds to” from “when the record becomes available.” If the June statistical report is not finalized until mid-July, a forecast made at the end of June cannot directly use the final values. For data that get revised, it is best to keep the version visible at the time; for labels that can only be determined after follow-up, schedule the training cutoff according to when the labels mature.

TimeSeriesSplit[2] provides a tool for splitting training, test and gap in sequence, where the gap is counted in number of samples, not calendar days. Ten records a day and one record every ten days cannot be interpreted as the same time distance by the same gap. When labels overlap or sampling is irregular, first lay out the real time ranges clearly, then decide which records must be kept apart.

Make the Evaluation Match Future Use

A reusable evaluation scheme should spell out four things: when forecasts are issued, how far ahead they look, when the model is updated, and what data can be obtained at that time. The windows, validation origins and final test segment are then fixed accordingly. When comparing models, all candidates should face the same set of origins and the same scoring method.

The value of rolling validation lies in reproducing, round after round, the working condition of “looking forward from where we stood then.” How the error varies by month is also worth keeping: a model with a slightly better average score that keeps missing in months when demand surges may not suit real resource planning. What model selection must ultimately answer is which scheme is more reliable at the moments when a decision actually has to be made.

References

  1. Hyndman, R. J., & Athanasopoulos, G. (2021). Forecasting: Principles and Practice (3rd ed.), §5.10 Time series cross-validation. OTexts. Chapter text.

  2. scikit-learn developers. TimeSeriesSplit. scikit-learn official documentation, accessed 2026-11-04. API reference.

  3. scikit-learn developers. Common pitfalls and recommended practices. scikit-learn official documentation, accessed 2026-11-04. Data leakage and preprocessing.

  4. Research Methods · Rituals can be imitated; understanding cannot be faked

  5. Compiled and published by the Scholay all-in-one academic platform. Please contact us to have it taken down in case of infringement.

  6. Also published at Enter Scholar, a scholar community for the age of intelligence