Time-Series Train-Test Split Calculator

Design chronological training, validation, and testing windows with rolling backtests, forecast horizons, leakage safeguards, seasonal alignment, fold tables, and clear visual summaries for forecasting.

Dataset Configuration

Describe the ordered dataset before selecting split windows.

Split Basis

Window and Forecast Settings

Use zero for unlimited expansion.
Use zero for every possible fold.

Gap, Purge, and Leakage Controls

Lookback, Lag, and Warm-Up Settings

Seasonality and Boundary Alignment

Missing Timestamp Handling

Presets and Actions

Formula Used

Training observations = floor(available observations × training percentage ÷ 100)

Validation observations = floor(available observations × validation percentage ÷ 100)

Testing observations = available observations − training observations − validation observations

Fold test start = training origin + excluded gap + validation window

Usable training observations = training observations − maximum required warm-up

How to Use

  1. Enter the total ordered observations and optional dataset dates.
  2. Select a chronological, expanding, rolling, or walk-forward method.
  3. Choose percentages, exact counts, or explicit date boundaries.
  4. Set forecast horizon, window sizes, gap, and step size.
  5. Add lag, seasonality, missing-period, and leakage controls.
  6. Calculate, inspect every fold, then export the report.

Example Data

ScenarioObservationsMethodInitial trainHorizonStepGap
Daily demand1,095Expanding73030307
Hourly traffic8,760Rolling2,16016816824
Monthly revenue120Walk-forward601210

Time-Series Splitting Guidance

Time-series observations must preserve chronological order. Random shuffling can expose future information. This creates misleading validation scores.

Expanding windows retain all earlier observations. Rolling windows discard older observations. Choose based on expected concept drift.

A gap separates training from evaluation periods. It protects lagged features near boundaries. The gap should cover important dependencies.

Backtesting simulates repeated production forecasts. Each fold creates a new forecast origin. Review stability across every evaluation window.

Frequently Asked Questions

Why is random shuffling disabled?

Random shuffling mixes past and future observations. That can leak information into training. Chronological splitting better represents real forecasting.

What is an expanding window?

An expanding window keeps all earlier training data. Its training range grows every fold. This suits stable long-term patterns.

What is a rolling window?

A rolling window uses a fixed training length. Older records leave as time advances. This can handle changing relationships.

How large should the test window be?

Match the window to the real forecast horizon. A monthly decision may need thirty days. Longer windows require more data.

When should I use a gap?

Use a gap when features use recent history. It is also useful with delayed labels. The gap should exceed risky dependencies.

Does validation data always matter?

Validation data supports model and parameter selection. Testing should remain untouched until final evaluation. Small datasets may use nested backtesting.

What does partial final window mean?

The remaining observations may not fill another horizon. You can drop or shorten that fold. Keep the decision consistent across experiments.

How do seasonal cycles affect splits?

Incomplete cycles can bias model comparison. Align boundaries with full seasons when practical. Always preserve enough cycles for learning.

How are missing timestamps handled?

The calculator reports missing periods and policies. Actual imputation must occur before modelling. Fit imputation rules inside training folds.

Related Calculators

Moving Average Forecast CalculatorExponential Smoothing CalculatorForecast Error CalculatorLag Feature CalculatorMean Absolute Scaled Error CalculatorWalk-Forward Validation Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.