Dictionary of Applied Machine Learning: 107 machine-learning terms, each with a definition, a figure, citations and a Python demo · All terms · Demos · Start here
Updated on 2026-10-08
Readiness 97/100
See also training set validation set test set generalization
Data leakage arises when a machine learning (ML) method uses features that are available during training but not at prediction time. For example, in weather forecasting each data point covers a time interval, and one feature is the temperature one hour ahead of the forecast time. On historic data this later measurement is available, but when a forecast is actually computed it is not, so the feature leaks information. A leaked feature makes the loss on the training set and test set look near zero, yet the learned hypothesis fails after deployment, because the feature cannot be reproduced at prediction time. The term is also used, in a security sense, for the unintentional release of sensitive information.

dataleakage.py, which recomputes what the entry states: the script block by block · open in ColabB-deployConsider a machine learning (ML) method trained on an hourly
temperature sequence, where each data point is a sliding
window of three consecutive hours (Fig. 1). The
label is the temperature of the middle hour, and one of the
features is the measurement one hour later. On historic data this
later measurement is available, so the loss on the training set
and test set looks near zero; but in real time the middle hour must
be predicted before the next hour is measured, so the learned
hypothesis is useless. This is data leakage: a feature used
during training or evaluation is unavailable when a
prediction must be delivered.
The term data leakage is also used, in an unrelated security sense, for the unintentional release of sensitive information (data exfiltration from a trained system), a meaning distinct from the methodological one defined above.
See also: test set contamination, training set, validation set, test set, generalization, risk.
@misc{dictml_dataleakage,
author = {Jung, Alexander},
editor = {Olioumtsevits, Konstantina and Schnoor, Ekkehard},
title = {data leakage},
howpublished = {Dictionary of Applied Machine Learning (course edition)},
year = {2026},
doi = {10.5281/zenodo.21569296},
note = {ISBN 978-952-64-3013-3, CC BY 4.0, retrieved 2026-10-27},
url = {https://dictionaryofml.org/terms/dataleakage.html}
}