Empirical risk minimization explained

Empirical risk minimization is a principle in statistical learning theory which defines a family of learning algorithms based on evaluating performance over a known and fixed dataset. The core idea is based on an application of the law of large numbers; more specifically, we cannot know exactly how well a predictive algorithm will work in practice (i.e. the true "risk") because we do not know the true distribution of the data, but we can instead estimate and optimize the performance of the algorithm on a known set of training data. The performance over the known set of training data is referred to as the "empirical risk".

Background

The following situation is a general setting of many supervised learning problems. There are two spaces of objects

X

and

Y

and would like to learn a function

h:X\toY

(often called hypothesis) which outputs an object

y\inY

, given

x\inX

. To do so, there is a training set of

n

examples

(x1,y1),\ldots,(xn,yn)

where

xi\inX

is an input and

yi\inY

is the corresponding response that is desired from

h(xi)

.

P(x,y)

over

X

and

Y

, and that the training set consists of

n

instances

(x1,y1),\ldots,(xn,yn)

drawn i.i.d. from

P(x,y)

. The assumption of a joint probability distribution allows for the modelling of uncertainty in predictions (e.g. from noise in data) because

y

is not a deterministic function of but rather a random variable with conditional distribution

P(y|x)

for a fixed

x

.

L(\hat{y},y)

which measures how different the prediction

\hat{y}

of a hypothesis is from the true outcome

y

. For classification tasks these loss functions can be scoring rules.The risk associated with hypothesis

h(x)

is then defined as the expectation of the loss function:

R(h)=E[L(h(x),y)]=\intL(h(x),y)dP(x,y).

A loss function commonly used in theory is the 0-1 loss function:

L(\hat{y},y)=\begin{cases}1&if\hat{y}\ney\ 0&if\hat{y}=y\end{cases}

.

The ultimate goal of a learning algorithm is to find a hypothesis

h*

among a fixed class of functions

l{H}

for which the risk

R(h)

is minimal:

h*=\underset{h\inl{H}}{\operatorname{argmin}}{R(h)}.

For classification problems, the Bayes classifier is defined to be the classifier minimizing the risk defined with the 0–1 loss function.

Empirical risk minimization

In general, the risk

R(h)

cannot be computed because the distribution

P(x,y)

is unknown to the learning algorithm (this situation is referred to as agnostic learning). However, given a sample of iid training data points, we can compute an estimate, called the empirical risk, by computing the average of the loss function over the training set; more formally, computing the expectation with respect to the empirical measure:

Remp(h)=

1
n
n
\sum
i=1

L(h(xi),yi).

The empirical risk minimization principle[1] states that the learning algorithm should choose a hypothesis

\hat{h}

which minimizes the empirical risk over the hypothesis class

lH

:

\hat{h}=\underset{h\inl{H}}{\operatorname{argmin}}Remp(h).

Thus, the learning algorithm defined by the empirical risk minimization principle consists in solving the above optimization problem.

Properties

Guarantees for the performance of empirical risk minimization depend strongly on the function class selected as well as the distributional assumptions made.[2] In general, distribution-free methods are too coarse, and do not lead to practical bounds. However, they are still useful in deriving asymptotic properties of learning algorithms, such as consistency. In particular, distribution-free bounds on the performance of empirical risk minimization given a fixed function class can be derived using bounds on the VC complexity of the function class.

For simplicity, considering the case of binary classification tasks, it is possible to bound the probability of the selected classifier,

\phin

being much worse than the best possible classifier

\phi*

. Consider the risk

L

defined over the hypothesis class

lC

with growth function

lS(lC,n)

given a dataset of size

n

. Then, for every

\epsilon>0

:[3]

\mathbb P \left (L(\phi_n) - L(\phi^*) \right) \leq \mathcal 8S(\mathcal C, n) \exp\

Similar results hold for regression tasks.[2] These results are often based on uniform laws of large numbers, which control the deviation of the empirical risk from the true risk, uniformly over the hypothesis class.[3]

Impossibility results

It is also possible to show lower bounds on algorithm performance if no distributional assumptions are made.[4] This is sometimes referred to as the No free lunch theorem. Even though a specific learning algorithm may provide the asymptotically optimal performance for any distribution, the finite sample performance is always poor for at least one data distribution. This means that no classifier can provide on the error for a given sample size for all distributions.[3]

Specifically, Let

\epsilon>0

and consider a sample size

n

and classification rule

\phin

, there exists a distribution of

(X,Y)

with risk

L*=0

(meaning that perfect prediction is possible) such that:[3] \mathbb E L_n \geq 1/2 - \epsilon.

It is further possible to show that the convergence rate of a learning algorithm is poor for some distributions. Specifically, given a sequence of decreasing positive numbers

ai

converging to zero, it is possible to find a distribution such that:

[6] Minimizing the latter using convex optimization also allow to control the former.

Tilted empirical risk minimization

Tilted empirical risk minimization is a machine learning technique used to modify standard loss functions like squared error, by introducing a tilt parameter. This parameter dynamically adjusts the weight of data points during training, allowing the algorithm to focus on specific regions or characteristics of the data distribution. Tilted empirical risk minimization is particularly useful in scenarios with imbalanced data or when there is a need to emphasize errors in certain parts of the prediction space.

See also

Further reading

Notes and References

  1. V. Vapnik (1992). Principles of Risk Minimization for Learning Theory.
  2. Book: Györfi . László . A Distribution-Free Theory of Nonparametric Regression . Kohler . Michael . Krzyzak . Adam . Walk . Harro . 2010-12-01 . Springer . 978-1-4419-2998-3 . Softcover reprint of the original 1st . New York . en.
  3. Devroye, L., Gyorfi, L. & Lugosi, G. A Probabilistic Theory of Pattern Recognition. Discrete Appl Math 73, 192–194 (1997)
  4. Devroye . Luc . Györfi . László . Lugosi . Gábor . 1996 . A Probabilistic Theory of Pattern Recognition . Stochastic Modelling and Applied Probability . 31 . en . 10.1007/978-1-4612-0711-5 . 978-1-4612-6877-2 . 0172-4568.
  5. V. Feldman, V. Guruswami, P. Raghavendra and Yi Wu (2009). Agnostic Learning of Monomials by Halfspaces is Hard. (See the paper and references therein)
  6. Web site: Mathematics of Machine Learning Lecture 9 Notes Mathematics of Machine Learning Mathematics . 2023-10-28 . MIT OpenCourseWare . en.