AI engineering glossary · ML fundamentals

What is train-test contamination?

Train-test contamination (also called Test-set contamination): When information from the test data influences training, whether through preprocessing fitted on all rows, duplicate records across the split or repeated tuning against the test set. It makes reported performance unrealistically high.

Level: intermediateTopic: ML fundamentals

Train-test contamination: an example

Computing the mean used for scaling on the whole dataset before splitting lets test statistics shape the training features.

Related terms

More ML fundamentals terms

Where you learn it

Train-test contamination is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.