Intermediate · 7 min
AI and data: prevent train–test leakage
Performance on previously seen data does not show ability to predict a new experiment.
Define what is new
Split by batch, material or campaign according to the question. Repeated tests placed in both train and test can inflate evaluation.
Build a pipeline
Fit normalization and transformations only on training data. A pipeline helps avoid mistakes during cross-validation.
Report limitations
Keep an independent test set and compare with a simple baseline. State the data domain; the model is not validated beyond it.
Practical example
Output: separated batch table, documented pipeline, test error and covered experimental conditions.
References
scikit-learn — Common pitfalls
scikit-learn — Cross-validation
Commercial disclosure: CATAL is preparing equipment sales. Product links do not demonstrate scientific superiority.