Dictionary of Applied Machine Learning
Typeset PDF version — the authoritative form of this entry
Generalization is the ability of a machine learning (ML) method to make accurate predictions on data points that have not been used during training. Many ML methods implement training via empirical risk minimization (ERM), i.e., learning a hypothesis $\learnthypothesis$ that minimizes the empirical risk on the training set $\trainset$. The learned $\learnthypothesis$ is then used to compute predictions on new data points outside $\trainset$. A probabilistic model for data generation quantifies the prediction errors beyond $\trainset$ via the risk of $\learnthypothesis$, i.e., the expected loss incurred on a new randomly chosen data point. The difference between the risk and the empirical risk is the generalization gap. A complementary deterministic view characterizes generalization via the robustness of $\learnthypothesis$ to small perturbations of the features of a data point.
A weather forecaster trained on past data is useful only if its predictions are accurate on future unseen data points. Generalization refers to the ability of a learned hypothesis $\learnthypothesis$ to make similarly accurate predictions on data points that have not been used during training. It is the central goal of machine learning (ML): learning patterns in the features and labels of data points that extend beyond the training set.
The canonical learning technique is empirical risk minimization (ERM): the machine learning system (ML system) obtains $\learnthypothesis \in \hypospace$ by minimizing the empirical risk on the training set $\trainset$. A low empirical risk on $\trainset$ does not guarantee accurate predictions on data points outside $\trainset$. Online learning and Bayesian inference face the same generalization challenge.
Studying generalization mathematically requires formalizing
the notion of unseen data points. A widely
used approach is to assume a probabilistic model for the
generation of data points, such as the
independent and identically distributed assumption (i.i.d.\ assumption). Here, data points are interpreted as
independent random variables (RVs) with an identical, fixed but
unknown, probability distribution $\probdist$.
Fig. 1 sketches this setup:
the shaded ellipse depicts the region of typical
data points under $\probdist$, and the two large
filled circles are the data points of the
training set that ERM fits with the learned
hypothesis $\learnthypothesis$. The risk of
$\learnthypothesis$ is the expected loss:
\[
\risk{\learnthypothesis} = \expect
\left\{ \lossfunc{\datapoint}{\learnthypothesis} \right\}.
\]
The difference $\risk{\learnthypothesis} -
\emprisk{\learnthypothesis}{\trainset}$ is the generalization gap.
See also: empirical risk minimization, empirical risk, risk, generalization gap, independent and identically distributed assumption, training set, validation error, test set, overfitting, validation, regularization, hypothesis, hypothesis space, online learning, Bayesian inference.
@misc{dictml_generalization,
author = {Jung, Alexander},
title = {generalization},
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-08-06},
url = {https://dictionaryofml.org/terms/generalization.html}
}