For supervised learning applications in machine learning and statistical learning theory, generalization error[1] (also known as the out-of-sample error[2] or the risk) is a measure of how accurately an algorithm is able to predict outcome values for previously unseen data. Because 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 predictive ability on new data. Generalization error can be minimized by avoiding overfitting in the learning algorithm. The performance of a machine learning algorithm is visualized by plots that show values of estimates of the generalization error through the learning process, which are called learning curves.
In a learning problem, the goal is to develop a function [math]\displaystyle{ f_n(\vec{x}) }[/math] that predicts output values [math]\displaystyle{ y }[/math] for each input datum [math]\displaystyle{ \vec{x} }[/math]. The subscript [math]\displaystyle{ n }[/math] indicates that the function [math]\displaystyle{ f_n }[/math] is developed based on a data set of [math]\displaystyle{ n }[/math] data points. The generalization error or expected loss or risk [math]\displaystyle{ I[f] }[/math] of a particular function [math]\displaystyle{ f }[/math] over all possible values of [math]\displaystyle{ \vec{x} }[/math] and [math]\displaystyle{ y }[/math] is the expected value of the loss function [math]\displaystyle{ V(f) }[/math]:[1]
where [math]\displaystyle{ \rho(\vec{x},y) }[/math] is the unknown joint probability distribution for [math]\displaystyle{ \vec{x} }[/math] and [math]\displaystyle{ y }[/math].
Without knowing the joint probability distribution [math]\displaystyle{ \rho }[/math], it is impossible to compute [math]\displaystyle{ I[f] }[/math]. Instead, we can compute the error on sample data, which is called empirical error (or empirical risk). Given [math]\displaystyle{ n }[/math] data points, the empirical error of a candidate function [math]\displaystyle{ f }[/math] is:
An algorithm is said to generalize if:
Of particular importance is the generalization error [math]\displaystyle{ I[f_n] }[/math] of the data-dependent function [math]\displaystyle{ f_n }[/math] that is found by a learning algorithm based on the sample. Again, for an unknown probability distribution, [math]\displaystyle{ I[f_n] }[/math] 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:
That is, the goal is to characterize the probability [math]\displaystyle{ 1 - \delta_n }[/math] that the generalization error is less than the empirical error plus some error bound [math]\displaystyle{ \epsilon }[/math] (generally dependent on [math]\displaystyle{ \delta }[/math] and [math]\displaystyle{ n }[/math]). 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 stability, says that to be stable, the prediction error for each data point when leave-one-out cross validation is used must converge to zero as [math]\displaystyle{ n\rightarrow \infty }[/math]. The second condition, expected-to-leave-one-out error stability (also known as hypothesis stability if operating in the [math]\displaystyle{ L 1 }[/math] 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.[3]
These conditions can be formalized as:
An algorithm [math]\displaystyle{ L }[/math] has [math]\displaystyle{ CVloo }[/math] stability if for each [math]\displaystyle{ n }[/math], there exists a [math]\displaystyle{ \beta_{CV}^{(n)} }[/math] and [math]\displaystyle{ \delta_{CV}^{(n)} }[/math] such that:
and [math]\displaystyle{ \beta_{CV}^{(n)} }[/math] and [math]\displaystyle{ \delta_{CV}^{(n)} }[/math] go to zero as [math]\displaystyle{ n }[/math] goes to infinity.[3]
An algorithm [math]\displaystyle{ L }[/math] has [math]\displaystyle{ Eloo_{err} }[/math] stability if for each [math]\displaystyle{ n }[/math] there exists a [math]\displaystyle{ \beta_{EL}^m }[/math] and a [math]\displaystyle{ \delta_{EL}^m }[/math] such that:
with [math]\displaystyle{ \beta_{EL}^{(n)} }[/math] and [math]\displaystyle{ \delta_{EL}^{(n)} }[/math] going to zero for [math]\displaystyle{ n\rightarrow\infty }[/math].
For leave-one-out stability in the [math]\displaystyle{ L_1 }[/math] norm, this is the same as hypothesis stability:
with [math]\displaystyle{ \beta_H^{(n)} }[/math] going to zero as [math]\displaystyle{ n }[/math] goes to infinity.[3]
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.
The concepts of generalization error and overfitting are closely related. Overfitting occurs when the learned function [math]\displaystyle{ f_S }[/math] becomes sensitive to the noise in the sample. As a result, the function will perform well on the training set but not perform well on other data from the joint probability distribution of [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math]. Thus, the more overfitting occurs, the larger the generalization error.
The amount of overfitting can be tested using cross-validation methods, that split the sample into simulated training samples and testing samples. The model is then trained on a training sample and evaluated on the testing sample. The testing sample is previously unseen by the algorithm and so represents a random sample from the joint probability distribution of [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math]. 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.
Original source: https://en.wikipedia.org/wiki/Generalization error.
Read more |