Three roles, three sets
Training data fits model parameters. Validation data tunes hyperparameters and selects candidates. Test data asks one final question: did the choices made on validation generalize? If a test score causes another feature or model change, the test set has become validation data and its estimate is no longer independent.
Random is not always the deployment reality
Random splitting is reasonable only when rows are independent and time is irrelevant. Stratify imbalanced classification labels when each set needs comparable prevalence. When several rows belong to one user, patient, or document, split by that entity so the model cannot recognize the same object on both sides.
When time matters, put the future later
For demand, churn, or fraud, train on earlier periods and validate on more recent periods. Random shuffling can teach the model future policy, prices, seasonality, or behavior and then ask it to predict the past. Rolling windows can show whether performance depends on one fortunate interval and can mirror the planned retraining cadence.
Validation wears out too
Comparing dozens of models on the same validation rows adapts the team's decisions to that set's noise. Record experiment count and decision logic. Use cross-validation when data is small, but still preserve an independent final test set after feature, model, and hyperparameter selection.
Freeze the test set
Store stable row or entity identifiers and the dataset version on day one. A random seed alone is insufficient because changed source data produces different rows with the same seed. If the data definition changes, create a new versioned dataset and test set. At final evaluation, report baseline difference, uncertainty or fold variability, and important subgroup errors—not one score alone.
The split is part of the deployment contract
Version the grouping unit, time boundary, generation query, identifiers, and data hash. These details state which unseen future the score is meant to represent and allow the same evaluation question to be reconstructed. The split is the history of the experiment, not disposable setup code.