Lably
Skip to content

Generalization error

Measure of algorithm accuracy

  • 4 min read
  • 2 chapters

Related on Lably

Through Machine learning, Algorithm and Sampling error

Definition

In a learning problem, the goal is to develop a function fn(x→) that predicts output values y for each input datum x→. The subscript n indicates that the function fn is developed based on a data set of n data points. The generalization error or expected loss or risk I[f] of a particular function f over all possible values of x→ and y is the expected value of the loss function V(f):

I[f]=∫X×YV(f(x→),y)ρ(x→,y)dx→dy,

where ρ(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 error on sample data, which is called empirical error (or empirical risk). Given n data points, the empirical error of a candidate function f is:

In[f]=1n∑i=1nV(f(x→i),yi)

An algorithm is said to generalize if:

limn→∞I[f]−In[f]=0

Of particular importance is the generalization error I[fn] of the data-dependent function fn that is found by a learning algorithm based on the sample. Again, for an unknown probability distribution, I[fn] 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:

PG=P(I[fn]−In[fn]≤ϵ)≥1−δn

That is, the goal is to characterize the probability 1−δn that the generalization error is less than the empirical error plus some error bound ϵ (generally dependent on δ and n). 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 L1 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 CVloo stability if for each n, there exists a βCV(n) and δCV(n) such that:

∀i∈{1,...,n},PS{|V(fSi,zi)−V(fS,zi)|≤βCV(n)}≥1−δCV(n)

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

Expected-leave-one-out error Stability

An algorithm L has Elooerr stability if for each n there exists a βELm and a δELm such that:

∀i∈{1,...,n},PS{|I[fS]−1n∑i=1NV(fSi,zi)|≤βEL(n)}≥1−δEL(n)

with βEL(n) and δEL(n) going to zero for n→∞.

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

ES,z[|V(fS,z)−V(fSi,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.

Sign in to keep reading

One more chapter is free with a Lably account.

More in Robotics