Wikipedia / Generalization error
Wikipedia / Generalization error
For supervised learning applications in machine learning and statistical learning theory, generalization error (also known as the out-of-sample error or the risk) is a measure of how accurately an algorithm is able to predict outcomes for previously unseen data. As learning algorithms are evaluated on finite samples, the evaluation of a learning algorithm may be sensitive to sampling error. As a result, measurements of prediction error on the current data may not provide much information about the algorithm's predictive ability on new, unseen data. The generalization error can be minimized by avoiding overfitting in the learning algorithm. The performance of machine learning algorithms is commonly visualized by learning curve plots that show estimates of the generalization error throughout the learning process.
Definition
data points. The generalization error or expected loss or risk is the expected value of the loss function:
is the unknown joint probability distribution.
. Instead, we can compute the error on sample data, which is called empirical error (or empirical risk is:
An algorithm is said to generalize if:
Of particular importance is the generalization error cannot be computed. Instead, the aim of many problems in statistical learning theory is to bound or characterize the difference of the generalization error and the empirical error in probability:
). For many types of algorithms, it has been shown that an algorithm has generalization bounds if it meets certain stability criteria. Specifically, if an algorithm is symmetric (the order of inputs does not affect the result), has bounded loss and meets two stability conditions, it will generalize. The first stability condition, leave-one-out cross-validation. The second condition, expected-to-leave-one-out error stability (also known as hypothesis stability if operating in the L_1 norm) is met if the prediction on a left-out datapoint does not change when a single data point is removed from the training dataset.
These conditions can be formalized as:
Leave-one-out cross-validation Stability
such that:
goes to infinity.
Expected-leave-one-out error Stability
such that:
.
norm, this is the same as hypothesis stability:
goes to infinity.
Algorithms with proven stability
A number of algorithms have been proven to be stable and as a result have bounds on their generalization error. A list of these algorithms and the papers that proved stability is available here.
Relation to overfitting
. Thus, the more overfitting occurs, the larger the generalization error.
The amount of overfitting can be tested using cross-validation. This test sample allows us to approximate the expected error and as a result approximate a particular form of the generalization error.
Many algorithms exist to prevent overfitting. The minimization algorithm can penalize more complex functions (known as Tikhonov regularization), or the hypothesis space can be constrained, either explicitly in the form of the functions or by adding constraints to the minimization function (Ivanov regularization).
The approach to finding a function that does not overfit is at odds with the goal of finding a function that is sufficiently complex to capture the particular characteristics of the data. This is known as the bias–variance tradeoff. Keeping a function simple to avoid overfitting may introduce a bias in the resulting predictions, while allowing it to be more complex leads to overfitting and a higher variance in the predictions. It is impossible to minimize both simultaneously.
References
Further reading
Mohri, M., Rostamizadeh A., Talwakar A., (2018) Foundations of Machine learning, 2nd ed., Boston: MIT Press.
Moody, J.E. (1992), "The Effective Number of Parameters: An Analysis of Generalization and Regularization in Nonlinear Learning Systems ", in Moody, J.E., Hanson, S.J., and Lippmann, R.P., Advances in Neural Information Processing Systems 4, 847–854.
White, H. (1992b), Artificial Neural Networks: Approximation and Learning Theory, Blackwell.