Training data help a model learn; validation data help developers choose or tune a model; test data provide an evaluation intended to be independent of those design choices; holdout data are records deliberately withheld from specified development steps; and deployment data are the cases the running system actually encounters. These labels describe roles in an evaluation process, not permanent properties of files. A dataset called “test” ceases to offer a clean independent check if its results are repeatedly used to choose the model. A deployment dataset may have different users, dates or formats even when a laboratory score looked excellent. Correct terminology is part of protecting evidence from being accidentally used twice.
The practical method is to define the intended real-world task first, separate data according to the actual independence required, fit transformations only on permitted training information, guard against duplicates and time leakage, then verify the model under realistic deployment conditions. Not every project needs one rigid percentage split, and cross-validation has different designs for independent, grouped and time-ordered observations. The useful question is not whether a project has five folders named correctly; it is whether the reported test genuinely probes behaviour the developers had not already optimised on. For consequential AI, independent evaluation and monitoring must remain open to correction.
- Training: Examples used to fit a model or data transformation
- Validation: Examples used to compare, select and tune development alternatives
- Test: Examples intended to evaluate a chosen system without informing its selection
- Holdout: Material reserved from defined stages, possibly used for validation or final testing
- Deployment: The inputs, outputs and outcomes generated during real use
- Leakage: Information unavailable in the intended prediction task reaches development or evaluation improperly
- Evidence boundary: Good data splits do not prove a model is safe in every future population
Chapter Index
- 1. Five Roles, Not Five Magical Types of Files
- 2. Why the Three-Way Split Exists
- 3. Leakage: How Tomorrow’s Information Enters Yesterday’s Model
- 4. Cross-Validation Is a Method, Not a Magic Word
- 5. Overfitting and Generalisation Are Different Outcomes
- 6. Deployment Is an Ongoing Evidence Source
- 7. Practical Examples at Multiple Zoom Levels
- 8. A Seven-Question Audit and a Seven-Day Exercise
- 9. Frequently Asked Questions
1. Five Roles, Not Five Magical Types of Files
What do training examples do?
Training examples influence learned parameters, features, representations or other aspects of the fitted system. A model may learn from labelled records, self-supervised text or other training objectives. A data preparation step such as scaling may also be fitted from training data. The Google Machine Learning Crash Course separates training from subsequent validation and testing. Training performance alone does not establish generalisation: the model has already encountered these data in some form.
What is validation data?
A validation set helps developers select hyperparameters, architectures, thresholds, features or checkpoints during experimentation. It is part of the development feedback loop. The model may not directly fit its weights on every validation example, but repeated decisions based on those results still influence the final selected system. Calling that set unseen without qualification can be misleading. It may be unseen during weight fitting but thoroughly consulted during model selection.
What is test data?
A test set is intended to assess a developed model on examples not used to choose its design. It should resemble the intended task and use a suitable reference and evaluation method. Google’s dataset splitting guidance warns that repeatedly using test scores to tune hyperparameters makes the set less independent. A final test is an evaluation of one specified system under one defined distribution, not an eternal certificate of quality.
What does holdout mean?
Holdout refers to data deliberately withheld from certain training or selection activities. In some workflows it is the final test set; in others the term describes any reserved validation or evaluation subset. The label alone does not establish how independent the records remained. A clean report states exactly what the holdout was withheld from, who inspected the results and whether subsequent revisions were made because of its performance. The process matters more than the folder’s name.
What are deployment data?
Deployment data are the actual cases, requests, features and results encountered by the running system. They may contain new populations, changing vocabulary, emerging products and unexpected input formats. Some outcomes become available only after a delay, so a live dashboard may not know the correct reference label for every prediction. Google’s production monitoring guide stresses watching serving data and actual model behaviour. A production record has a different purpose from a training snapshot.
These roles may overlap in time but not in claimed independence
An organisation can legitimately use earlier production data for later retraining when privacy, consent and other requirements allow it. Once those data help develop the next model, however, they should not be marketed as an independent test for that next version without suitable controls. New data can move between roles across versioned experiments. The audit must record when and how each split was used, not assert that a fixed filename forever determines its epistemic status.
2. Why the Three-Way Split Exists
The basic development cycle
A simple workflow uses training data to fit the model, validation data to compare alternatives and final test data to examine the chosen version. This creates different layers of evidence. The exact proportions depend on dataset size, dependence among observations and the deployment task. Google’s guidance uses illustrative percentages but does not establish universal minimum percentages. A much smaller dataset may need an appropriate cross-validation design rather than copying one default diagram.
Training score is not generalisation
Imagine a classifier remembering a fixed collection of customer messages and returning perfect labels for all of them. That is performance on familiar material. Its behaviour on genuinely new messages may be much poorer. High training accuracy can coexist with overfitting, where the system has learned peculiarities that do not generalise. The test must challenge the model with information outside its fitting process. Repetition of known cases does not prove robustness to unfamiliar language or circumstances.
Validation can guide improvement without proving final quality
Developers might compare ten candidate models on the validation set, then tune the best one repeatedly. That is a normal development practice. Yet the chosen model may gradually fit properties peculiar to the validation distribution. Reporting the highest validation score as a fully independent estimate hides this selection process. A fresh, appropriately held-out evaluation can provide additional evidence. Even that evidence remains tied to the evaluated population, reference labels and use case.
A test set wears out
Repeatedly examining the same test scores and adjusting the model accordingly can make the team indirectly optimise to that set. This resembles repeatedly practising on the exact examination questions while claiming a later score measures unfamiliar ability. Google explicitly warns that validation and test sets can wear out through reuse. A responsible team can freeze the model before the intended final test, disclose any subsequent adaptations and acquire fresh independent data where appropriate.
One number needs the tested model version
An AI vendor might announce 96 percent accuracy without saying which checkpoint, prompt configuration, retrieval index, dataset version or threshold was evaluated. These details may affect results. A new software release can invalidate earlier comparisons even when the product brand remains unchanged. Maintain a manifest linking model, evaluation procedure, source records and date. The right unit of the claim is a versioned system under specific conditions, not an indefinitely trustworthy label.
A test sample can be unrepresentative
A genuinely independent set can still be inappropriate if it does not resemble the cases the model will encounter. A chatbot tested only on formal English documents may perform differently on informal messages or specialised legal text. Independence prevents some forms of leakage, but representativeness and task validity remain distinct questions. The evaluation should include realistic deployment populations, difficult examples and known high-severity failure types when possible.
3. Leakage: How Tomorrow’s Information Enters Yesterday’s Model
What is data leakage?
Data leakage occurs when a model is built or evaluated using information that would not legitimately be available at the moment or for the task being predicted. The scikit-learn common pitfalls guide explains that leakage often produces overly optimistic cross-validation results and poor performance on genuinely new data. Sometimes the leaked information is a target label; sometimes a preprocessing statistic or a future event. The essential question is whether the information belongs within the permitted evidence boundary.
Preprocessing must respect the split
Suppose a developer standardises numerical features using the mean calculated across the entire dataset before splitting it. Information from the future validation or test cases has influenced the transformation. The error can be subtle because the model’s main fitting procedure may never explicitly see the test labels. Scikit-learn recommends fitting preprocessing steps on training data and applying the learned transformation consistently to validation and test cases. Proper pipelines can help enforce this boundary.
Duplicate records can cross the boundary
A customer message may appear several times because of exports, retries or copies. Randomly splitting rows can place near-identical examples in training and testing. The model then appears to generalise while effectively recognising material it has already seen. The correct remedy depends on the entity and task: group related records before splitting, examine duplication and preserve legitimate distinct events where relevant. Simply deleting every repeated-looking sentence can erase useful evidence.
Group leakage involves people or organisations
Imagine a research dataset with five interviews from each person. A random row split may put interviews from the same person in both training and test sets. The model can learn individual characteristics and then appear excellent on supposedly unfamiliar interviews. Scikit-learn cross-validation guidance describes group-wise splitters that keep members of the same group together. A proper split follows the generalisation question: new interviews from known people or interviews from genuinely new people?
Time leakage can borrow future outcomes
A model forecasting next month’s demand must not use features that become known only after the prediction date. Randomly mixing future records into training can let the model learn patterns unavailable at the intended decision time. Time-aware splitting and point-in-time feature generation can reduce this risk. The test should emulate what the system would actually know on the prediction date. Including next month’s final sales number as an input is a factual impossibility for a genuine forward forecast.
Target leakage can look like an excellent discovery
A dataset might include a field called reviewCompleted that is populated only after the final outcome. If the model is supposed to predict whether the review will succeed beforehand, the field can reveal the answer indirectly. A high score may impress evaluators who did not trace how each feature was generated. Feature provenance and time-of-availability checks are essential. The model has not discovered a reliable predictive relationship if it only learned to read the outcome after the fact.
4. Cross-Validation Is a Method, Not a Magic Word
What is cross-validation?
Cross-validation evaluates a model over several training and validation partitions rather than a single fixed split, under a declared procedure. It can help estimate performance and compare alternatives, but its folds must respect the data’s dependence structure. A successful average score cannot fix target leakage, wrong labels or an unrepresentative source population. Scikit-learn’s cross-validation guide describes multiple splitters precisely because one pattern does not suit every task.
Ordinary K-fold needs appropriate independence
K-fold cross-validation partitions the examples into folds and evaluates repeatedly with one fold held out while others train the estimator. The usual logic relies on data being sufficiently exchangeable for the intended inference. If rows come from repeated observations of one patient or are ordered in time, ordinary random folds can create misleading performance estimates. The correct split reflects what unseen means in the actual deployment. It is not necessarily the split that produces the highest score.
Group K-fold preserves group boundaries
When the task involves generalisation to new people or devices, keeping all records from each group on one side of a fold can be important. Scikit-learn’s GroupKFold supports such partitions. The group identifier must represent the dependency the evaluator wants to avoid leaking across folds. If several accounts belong to the same organisation and the model could memorise organisational patterns, account-only grouping might still be insufficient. The split requires substantive understanding of the data.
Time-series splitting preserves chronology
For a forecasting task, evaluation usually needs earlier data for training and later data for testing. TimeSeriesSplit helps create time-ordered folds for appropriate equally spaced data, with options such as a gap. The split must still reflect availability of labels, delayed reporting and the intended forecast horizon. A model cannot be credited with future knowledge that the live service would not possess.
Cross-validation can coexist with a final independent test
A development team might use cross-validation within the training/development data to choose a model and a separate untouched test set for final assessment. This is often a useful design, though not the only defensible method. The important distinction is whether a reported score reflects model selection or evaluation after selection. An independent test can still be limited by sample size and population coverage. Do not call every cross-validation fold a certification of universal reliability.
Leakage can survive a sophisticated splitter
Even with group-aware or time-aware partitions, a feature can contain post-outcome information, or a preprocessing pipeline can be fitted globally. A wrong target definition can persist across every fold. The statistical procedure cannot inspect every business meaning automatically. The evaluation needs a data lineage review, temporal availability checks and suitable domain knowledge alongside correct software. Better mathematics does not compensate for incorrect premises.
5. Overfitting and Generalisation Are Different Outcomes
What is overfitting?
Overfitting occurs when a model captures patterns or peculiarities of its development data that do not generalise sufficiently well to the intended new cases. It can happen through excessive model complexity, repeated tuning or nonrepresentative data. A small model can overfit, and a large model can sometimes generalise well under appropriate conditions. The label should be supported by evidence, typically differences between development and genuinely appropriate evaluation performance rather than by the mere number of parameters.
Validation loss and training loss tell different stories
A training loss may continue to decrease while validation performance stops improving or worsens. That can be a warning of overfitting under the chosen evaluation procedure. But divergent curves can also arise from data differences or measurement problems. Review the split, preprocessing, sample sizes and target definition before declaring a single cause. A dashboard chart shows observed metrics; the proposed explanation remains an inference requiring evidence.
Good test performance is still bounded
A model can pass a well-designed independent test and later encounter new vocabulary, products, laws or user behaviours. The test was appropriate for the population and time for which it was designed. Future suitability may need monitoring and reevaluation. The point is not that testing is pointless, but that a test is a statement about specific evidence rather than an eternal promise of correctness. Document conditions under which it may cease to be representative.
Training-serving skew is another failure mode
Google’s production ML guide describes training-serving skew when data schemas or feature engineering differ between training and deployment. A system may appear to perform well on its historical pipeline while producing different features live. That is not necessarily ordinary overfitting; it may be an engineering mismatch. Comparing actual production features with training expectations helps distinguish these problems.
The model may change the environment it predicts
A recommendation system affects which items people see, shaping the clicks and outcomes later collected for retraining. A model can become part of the process generating its future data. This feedback loop may introduce selection effects not represented in the original test set. Monitoring only overall accuracy can miss changes in exposure, fairness or group coverage. A responsible evaluation assesses the intervention and its consequences rather than assuming deployment data are passive observations.
Labels can drift while the file format stays constant
A company might redefine resolved customer support cases to require user confirmation, but old training labels recorded staff closure only. The data column still contains the same strings, yet the target changed. A model can perform reliably relative to the old label and fail the new objective. Versioning labels and linking them to effective policies helps avoid this semantic mismatch. Correct split design does not repair a wrong or outdated concept.
6. Deployment Is an Ongoing Evidence Source
Deploying is not the same as passing a test
Deployment means using the developed system in an actual operating environment under a defined scope. It may involve staged release, access controls and human oversight. A test can show performance before release without authorising the system to make high-impact decisions. The institution should identify intended users, task boundaries and appropriate incident response. A model that produces a valid prediction is not necessarily permitted to execute a consequential action. The final operational system is more than its model file.
Live metrics may lack ground-truth outcomes
An application can record how many predictions the model makes immediately, but it may not know which were correct until a person reviews them or a later event occurs. A rising positive prediction rate is not automatically rising true prevalence. Google’s productionisation guidance notes that live evaluation often relies on proxies until reliable outcomes are available. A good report distinguishes predictions, verified outcomes and provisional estimates.
Monitor data quality before celebrating accuracy
Production monitoring can detect unexpected missing fields, type changes, unusual value distributions and model output changes. These are signals for investigation rather than proof that specific predictions are wrong. A system might experience fewer alerts simply because telemetry stopped working. Monitoring should check both input pipeline integrity and appropriate performance measures. A clear status report says what was observed and which source or validation step supports the conclusion.
Distribution shift is broader than model drift
The input population may change abruptly when the application expands to a new country, or gradually as users adopt new habits. Either can make training data less representative. Concept or target relationships may also change, even when observed input distributions look similar. The phrase drift usually emphasises change over time, while distribution shift can encompass differences between environments. Their exact taxonomy varies in research, so an audit should describe the measured difference rather than use one fashionable label as an explanation.
Re-training can repair one issue and create another
Re-training on newer data may improve some behaviours while harming others. It can also import newly biased labels or reduce performance on older populations that still use the service. A responsible release evaluates the proposed version against relevant regression tests and current use cases before deployment. Keep earlier scores and model versions interpretable. “Updated” should not be automatically translated into “better” without appropriate evidence.
Deployment errors may be outside the model
The model might classify correctly while a connected tool sends the result to the wrong account or an interface mislabels a status. End-to-end evaluation includes retrieval, permissions, logging, human review and confirmed external outcomes. Training/validation/test distinctions are necessary but insufficient to prove a working service. A good organisation tests the user journey and treats failures as evidence to investigate, not just opportunities to retrain the model.
7. Practical Examples at Multiple Zoom Levels
A fictional spam filter
A company trains an email classifier on historical messages, tunes the threshold against validation data and evaluates once on a reserved test collection. At deployment, spammers change tactics and user inboxes differ. The score may fall even if the original evaluation was sound. Monitor real false alarms and missed spam with appropriate feedback, while respecting privacy. A test score is evidence about the earlier distribution, not a promise that all future messages are easy to classify.
A fictional document categoriser
A digital archive trains on documents from one century and tests on randomly split pages. Several pages of the same original document may appear on both sides, inflating results through shared spelling and handwriting. An evaluation for new documents should split by document or collection as appropriate. The question matters: predicting pages within familiar manuscripts differs from interpreting entirely unseen manuscripts. A useful report declares which kind of generalisation it tested.
A fictional service-demand forecast
A team forecasts next week’s requests from past weekly counts. Randomly shuffling records may allow future seasonal patterns into the apparent training history. Time-ordered evaluation better represents the intended task. Even then, the model might rely on a holiday calendar or policy rule that changes. The report should identify prediction horizon, information available at forecast time, error measure and the period evaluated. Data splitting and time semantics belong together.
A multilingual AI assistant
An assistant performs well on English support questions but receives complex requests in other languages after global deployment. The test data did not adequately cover these users. Reporting the earlier score as global reliability would exceed its scope. Evaluate the actual language varieties, translated status terms and relevant harms, with domain specialists where appropriate. Expanding the training collection may help, but it also requires properly defined labels and independent evaluation.
A public-sector application
An automated service may use historical approvals as training labels even though the current law has changed. A clean data split cannot make that outdated reference valid. The system should be reviewed against current policy, appropriate evidence and legal authority. It may need to restrict automation and provide an accessible appeal or correction route. A model can pass every technical test of the wrong rule while still producing unsuitable decisions.
8. A Seven-Question Audit and a Seven-Day Exercise
Seven questions before accepting a model score
Ask what the actual task is, what examples the model trained on, how validation guided development, whether the final test remained independent, which people or time periods can leak across splits, how reference labels were established, and whether the deployment population matches the evaluation. Also record what changed after deployment and how the score would be refreshed. Each answer supports a narrower and more credible performance claim.
Days one and two: build the data map
Choose a fictional collection of 100 labelled documents. On day one, define the intended population and group related records. On day two, propose a training, validation and final test arrangement. Explain what each subset will be used for. Avoid copying one numerical percentage split without understanding the size, grouping or rarity of the target cases. Record the split decision before examining model performance.
Days three and four: find leakage
On day three, deliberately create an example where the same document appears in training and testing, then describe the misleading effect. On day four, create a future-information feature that would not exist at prediction time. Identify how to prevent both errors, using grouped or time-aware splitting when appropriate. The aim is to understand the source of information leakage, not to produce an impressive score.
Days five and six: compare scores with use
On day five, imagine validation performance improves while independent test performance declines. Discuss whether repeated tuning might explain the pattern. On day six, introduce a new language or data format to the deployment population. Write what further evidence is needed before claiming the original performance transfers. Distinguish a data shift from a software bug and from a changed target label.
Day seven: publish a bounded model report
Record the model version, splits, reference labels, training sources, selection process, test metrics, uncertainty, deployment conditions and monitoring plan. Explain what was unavailable for independent checking. A responsible report is better when it identifies remaining uncertainties than when it conceals them behind the words fully tested. The user should know exactly which evidence supports the performance claim.
9. Frequently Asked Questions
Can validation data influence the chosen model?
Yes. That is one of their intended roles: developers use validation results to tune and compare alternatives. The score is therefore not always a fully independent final evaluation.
Is a holdout automatically a test set?
No. Holdout means reserved from defined stages. It might be used for validation, final testing or another purpose. Document how and when it was used.
Does random splitting prevent all leakage?
No. Duplicates, shared users, future information and globally fitted preprocessing can cross the split. Use the dependence structure appropriate to the question.
Can repeated testing wear out a test set?
Yes. Repeated model adjustments based on its results compromise independence. A fresh test or transparently reported development history may be needed.
Does a perfect test score prove a model works everywhere?
No. The test has a specific population, reference and task. New settings or changed conditions may require independent validation and monitoring.
Is deployment data always safe to reuse for training?
No. Access rights, privacy, selection effects, label quality and ongoing evaluation independence require review. Data reuse is not justified by technical availability alone.
Continue the Vocabulary at Every Zoom Level
These companion articles distinguish dataset quality, model evidence, changing populations and the legal or institutional meaning of labels across every zoom level.
- AI Tests, Benchmarks, Evaluation and Certification
- Sampling Bias, Measurement Bias and Algorithmic Bias
- Population, Sample, Cohort, Dataset and Census
- AI Training Data, Labels and Ground Truth
- Deterministic, Repeatable, Reproducible and Replicable
- AI Confidence, Probability and Calibration
Companion Articles in This Batch
Follow these connected guides to distinguish statistical evidence, AI model evaluation, missing information and changing data populations. Each explores a different boundary between a useful number and an unsupported conclusion.
- Sensitivity, Specificity, Precision, Recall and Prevalence
- Missing, Censored, Truncated, Suppressed and Withheld Data
- Trend, Seasonality, Cycle, Drift and Distribution Shift
Sources and Further Reading
- Google: Dividing Training, Validation and Test Data
- scikit-learn: Common Pitfalls and Data Leakage
- scikit-learn: Cross-Validation and Group-Based Splits
- scikit-learn: TimeSeriesSplit
- Google: Monitoring Production ML Systems
- Google: Model Productionisation and Monitoring
- Google: Rules of Machine Learning