Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Empirical risk minimization
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Principle in statistical learning theory}} {{Machine learning|Mathematical foundations}} In [[statistical learning theory]], the principle of '''empirical risk minimization''' defines a family of [[machine learning|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 [[Estimation statistics|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 <math>X</math> and <math>Y</math> and we would like to learn a function <math>\ h: X \to Y</math> (often called ''hypothesis'') which outputs an object <math>y \in Y</math>, given <math>x \in X</math>. To do so, there is a ''training set'' of <math>n</math> examples <math>\ (x_1, y_1), \ldots, (x_n, y_n)</math> where <math>x_i \in X</math> is an input and <math>y_i \in Y</math> is the corresponding response that is desired from <math> h(x_i)</math>. To put it more formally, assuming that there is a [[joint probability distribution]] <math>P(x, y)</math> over <math>X</math> and <math>Y</math>, and that the training set consists of <math>n</math> instances <math>\ (x_1, y_1), \ldots, (x_n, y_n)</math> drawn [[i.i.d.]] from <math>P(x, y)</math>. The assumption of a joint probability distribution allows for the modelling of uncertainty in predictions (e.g. from noise in data) because <math>y</math> is not a deterministic function of {{nowrap|<math>x</math>,}} but rather a [[random variable]] with [[conditional distribution]] <math>P(y | x)</math> for a fixed <math>x</math>. It is also assumed that there is a non-negative real-valued [[loss function]] <math>L(\hat{y}, y)</math> which measures how different the prediction <math>\hat{y}</math> of a hypothesis is from the true outcome <math>y</math>. For classification tasks, these loss functions can be [[scoring rule]]s. The [[Risk (statistics)|risk]] associated with hypothesis <math>h(x)</math> is then defined as the [[Expected value|expectation]] of the loss function: : <math>R(h) = \mathbf{E}[L(h(x), y)] = \int L(h(x), y)\,dP(x, y).</math> A loss function commonly used in theory is the [[0-1 loss function]]: <math>L(\hat{y}, y) = \begin{cases} 1 & \mbox{ if }\quad \hat{y} \ne y \\ 0 & \mbox{ if }\quad \hat{y} = y \end{cases}</math>. The ultimate goal of a learning algorithm is to find a hypothesis <math> h^*</math> among a fixed class of functions <math>\mathcal{H}</math> for which the risk <math>R(h)</math> is minimal: : <math>h^* = \underset{h \in \mathcal{H}}{\operatorname{arg\, min}}\, {R(h)}.</math> For classification problems, the [[Bayes classifier]] is defined to be the classifier minimizing the risk defined with the 0–1 loss function. == Formal definition == In general, the risk <math>R(h)</math> cannot be computed because the distribution <math>P(x, y)</math> is unknown to the learning algorithm. However, given a sample of [[Independent and identically distributed random variables|iid]] training data points, we can compute an [[Estimate (statistics)|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]]: : <math>\! R_\text{emp}(h) = \frac{1}{n} \sum_{i=1}^n L(h(x_i), y_i).</math> The empirical risk minimization principle<ref>V. Vapnik (1992). [https://papers.nips.cc/paper_files/paper/1991/file/ff4d5fbbafdf976cfdc032e3bde78de5-Paper.pdf ''Principles of Risk Minimization for Learning Theory.'']</ref> states that the learning algorithm should choose a hypothesis <math>\hat{h}</math> which minimizes the empirical risk over the hypothesis class <math>\mathcal H</math>: : <math>\hat{h} = \underset{h \in \mathcal{H}}{\operatorname{arg\, min}}\, R_{\text{emp}}(h).</math> Thus, the learning algorithm defined by the empirical risk minimization principle consists in solving the above [[Mathematical optimization|optimization]] problem. == Properties == {{Expand section|date=February 2023}} Guarantees for the performance of empirical risk minimization depend strongly on the function class selected as well as the distributional assumptions made.<ref name=lg>{{Cite book |last1=Györfi |first1=László |title=A Distribution-Free Theory of Nonparametric Regression |last2=Kohler |first2=Michael |last3=Krzyzak |first3=Adam |last4=Walk |first4=Harro |date=2010-12-01 |publisher=Springer |isbn=978-1-4419-2998-3 |edition=Softcover reprint of the original 1st |location=New York |language=en}}</ref> 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 (statistics)|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 [[Vapnik–Chervonenkis dimension|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, <math>\phi_n</math> being much worse than the best possible classifier <math>\phi^*</math>. Consider the risk <math>L</math> defined over the hypothesis class <math>\mathcal C</math> with [[growth function]] <math>\mathcal S(\mathcal C, n)</math> given a dataset of size <math>n</math>. Then, for every <math>\epsilon > 0</math>:<ref name='patt'>Devroye, L., Gyorfi, L. & Lugosi, G. A Probabilistic Theory of Pattern Recognition. Discrete Appl Math 73, 192–194 (1997)</ref> <math display='block'> \mathbb P \left (L(\phi_n) - L(\phi^*) > \epsilon \right ) \leq \mathcal 8S(\mathcal C, n) \exp\{-n\epsilon^2 / 32\} </math> Similar results hold for regression tasks.<ref name=lg/> These results are often based on [[uniform law of large numbers|uniform laws of large numbers]], which control the deviation of the empirical risk from the true risk, uniformly over the hypothesis class.<ref name='patt'/> ===Impossibility results=== It is also possible to show lower bounds on algorithm performance if no distributional assumptions are made.<ref>{{Cite journal |last1=Devroye |first1=Luc |last2=Györfi |first2=László |last3=Lugosi |first3=Gábor |date=1996 |title=A Probabilistic Theory of Pattern Recognition |url=https://link.springer.com/book/10.1007/978-1-4612-0711-5 |journal=Stochastic Modelling and Applied Probability |volume=31 |language=en |doi=10.1007/978-1-4612-0711-5 |isbn=978-1-4612-6877-2 |issn=0172-4568|url-access=subscription }}</ref> 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 improve on the error for a given sample size for all distributions.<ref name='patt'/> Specifically, let <math>\epsilon > 0</math> and consider a sample size <math>n</math> and classification rule <math>\phi_n</math>, there exists a distribution of <math>(X, Y)</math> with risk <math>L^* =0</math> (meaning that perfect prediction is possible) such that:<ref name='patt'/> <math display='block'>\mathbb E L_n \geq 1/2 - \epsilon.</math> 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 <math>a_i</math> converging to zero, it is possible to find a distribution such that: <math display='block> \mathbb E L_n \geq a_i</math> for all <math>n</math>. This result shows that universally good classification rules do not exist, in the sense that the rule must be low quality for at least one distribution.<ref name='patt'/> === Computational complexity === Empirical risk minimization for a classification problem with a [[0-1 loss function]] is known to be an [[NP-hard]] problem even for a relatively simple class of functions such as [[linear classifier]]s.<ref>V. Feldman, V. Guruswami, P. Raghavendra and Yi Wu (2009). [https://arxiv.org/abs/1012.0729 ''Agnostic Learning of Monomials by Halfspaces is Hard.''] (See the paper and references therein)</ref> Nevertheless, it can be solved efficiently when the minimal empirical risk is zero, i.e., data is [[linearly separable]].{{Cn|date=December 2023}} In practice, machine learning algorithms cope with this issue either by employing a [[Convex optimization|convex approximation]] to the 0–1 loss function (like [[hinge loss]] for [[Support vector machine|SVM]]), which is easier to optimize, or by imposing assumptions on the distribution <math>P(x, y)</math> (and thus stop being agnostic learning algorithms to which the above result applies). In the case of convexification, Zhang's lemma majors the excess risk of the original problem using the excess risk of the convexified problem.<ref>{{Cite web |title=Mathematics of Machine Learning Lecture 9 Notes {{!}} Mathematics of Machine Learning {{!}} Mathematics |url=https://ocw.mit.edu/courses/18-657-mathematics-of-machine-learning-fall-2015/resources/mit18_657f15_l9/ |access-date=2023-10-28 |website=MIT OpenCourseWare |language=en}}</ref> 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== *[[M-estimator]] *[[Maximum likelihood estimation]] == References == {{Reflist}} == Further reading == * {{cite book | last=Vapnik | first=V. | author-link = Vladimir Vapnik | title=The Nature of Statistical Learning Theory | publisher = [[Springer-Verlag]] | series=Information Science and Statistics | year = 2000 | isbn=978-0-387-98780-4}} [[Category:Machine learning]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Cn
(
edit
)
Template:Expand section
(
edit
)
Template:Machine learning
(
edit
)
Template:Nowrap
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)