Trisha Shetty (Editor)

Generalization error

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Generalization error

In supervised learning applications in machine learning and statistical learning theory, generalization error (also known as the out-of-sample error) 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 measured by plots of the generalization error values through the learning process, which are called learning curves.

Contents

Definition

In a learning problem, the goal is to develop a function f ( x ) that predicts output values y based on some input data x . The expected error, I [ f n ] of a particular function f n over all possible values of x and y is:

I [ f n ] = X × Y V ( f n ( x ) , y ) ρ ( x , y ) d x d y ,

where V denotes a loss function and ρ ( x , y ) is the unknown joint probability distribution for x and y .

Without knowing the joint probability distribution, it is impossible to compute I [ f ] . Instead, we can compute the empirical error on sample data. Given n data points, the empirical error is:

I S [ f n ] = 1 n i = 1 n V ( f n ( x i ) , y i )

The generalization error is the difference between the expected and empirical error. This is the difference between error on the training set and error on the underlying joint probability distribution. It is defined as:

G = I [ f n ] I S [ f n ]

An algorithm is said to generalize if:

lim n I [ f n ] I S [ f n ] = 0

Since I [ f n ] cannot be computed for an unknown probability distribution, the generalization error cannot be computed either. Instead, the aim of many problems in statistical learning theory is to bound or characterize the generalization error in probability:

P G = P ( I [ f n ] I S [ f n ] ϵ ) 1 δ n

That is, the goal is to characterize the probability 1 δ n that the generalization error is less than some error bound ϵ (known as the learning rate and generally dependent on δ and n ).

Relation to stability

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 n . 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

An algorithm L has C V l o o stability if for each n , there exists a β C V ( n ) and δ C V ( n ) such that:

i { 1 , . . . , n } , P S { | V ( f S i , z i ) V ( f S , z i ) | β C V ( n ) } 1 δ C V ( n )

and β C V ( n ) and δ C V ( n ) go to zero as n goes to infinity.

Expected-leave-one-out error Stability

An algorithm L has E l o o e r r stability if for each n there exists a β E L m and a δ E L m such that:

i { 1 , . . . , n } , P S { | I [ f S ] 1 n i = 1 N V ( f S i , z i ) | β E L ( n ) } 1 δ E L ( n )

with β E L ( n ) and δ E L ( n ) going to zero for n .

For leave-one-out stability in the L 1 norm, this is the same as hypothesis stability:

E S , z [ | V ( f S , z ) V ( f S i , z ) | ] β H ( n )

with β H ( n ) going to zero as n 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

The concepts of generalization error and overfitting are closely related. Overfitting occurs when the learned function f S 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 x and y . 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 x and y . 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.

Additional literature

  • Bousquet, O., S. Boucheron and G. Lugosi. Introduction to Statistical Learning Theory. Advanced Lectures on Machine Learning Lecture Notes in Artificial Intelligence 3176, 169-207. (Eds.) Bousquet, O., U. von Luxburg and G. Ratsch, Springer, Heidelberg, Germany (2004)
  • Bousquet, O. and A. Elisseef (2002), Stability and Generalization, Journal of Machine Learning Research, 499-526.
  • Devroye L. , L. Gyorfi, and G. Lugosi (1996). A Probabilistic Theory of Pattern Recognition. Springer-Verlag. ISBN 978-0387946184.
  • Poggio T. and S. Smale. The Mathematics of Learning: Dealing with Data. Notices of the AMS, 2003
  • Vapnik, V. (2000). The Nature of Statistical Learning Theory. Information Science and Statistics. Springer-Verlag. ISBN 978-0-387-98780-4.
  • Bishop, C.M. (1995), Neural Networks for Pattern Recognition, Oxford: Oxford University Press, especially section 6.4.
  • Finke, M., and Müller, K.-R. (1994), "Estimating a-posteriori probabilities using stochastic network models," in Mozer, Smolensky, Touretzky, Elman, & Weigend, eds., Proceedings of the 1993 Connectionist Models Summer School, Hillsdale, NJ: Lawrence Erlbaum Associates, pp. 324–331.
  • Geman, S., Bienenstock, E. and Doursat, R. (1992), "Neural Networks and the Bias/Variance Dilemma", Neural Computation, 4, 1-58.
  • Husmeier, D. (1999), Neural Networks for Conditional Probability Estimation: Forecasting Beyond Point Predictions, Berlin: Springer Verlag, ISBN 1-85233-095-3.
  • McCullagh, P. and Nelder, J.A. (1989) Generalized Linear Models, 2nd ed., London: Chapman & Hall.
  • 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.
  • Ripley, B.D. (1996) Pattern Recognition and Neural Networks, Cambridge: Cambridge University Press.
  • Rohwer, R., and van der Rest, J.C. (1996), "Minimum description length, regularization, and multimodal data," Neural Computation, 8, 595-609.
  • Rojas, R. (1996), "A short proof of the posterior probability property of classifier neural networks," Neural Computation, 8, 41-43.
  • White, H. (1990), "Connectionist Nonparametric Regression: Multilayer Feedforward Networks Can Learn Arbitrary Mappings," Neural Networks, 3, 535-550. Reprinted in White (1992).
  • White, H. (1992a), "Nonparametric Estimation of Conditional Quantiles Using Neural Networks," in Page, C. and Le Page, R. (eds.), Proceedings of the 23rd Sympsium on the Interface: Computing Science and Statistics, Alexandria, VA: American Statistical Association, pp. 190–199. Reprinted in White (1992b).
  • White, H. (1992b), Artificial Neural Networks: Approximation and Learning Theory, Blackwell.
  • References

    Generalization error Wikipedia