In machine learning and mathematical optimization, loss functions for classification are computationally feasible loss functions representing the price paid for inaccuracy of predictions in classification problems (problems of identifying which category a particular observation belongs to). Given X {\displaystyle {\mathcal {X}}} as the space of all possible inputs (usually X ⊂ R d {\displaystyle {\mathcal {X}}\subset \mathbb {R} ^{d}} ), and Y = { − 1 , 1 } {\displaystyle {\mathcal {Y}}=\{-1,1\}} as the set of labels (possible outputs), a typical goal of classification algorithms is to find a function f : X → Y {\displaystyle f:{\mathcal {X}}\to {\mathcal {Y}}} which best predicts a label y {\displaystyle y} for a given input x → {\displaystyle {\vec {x}}} . However, because of incomplete information, noise in the measurement, or probabilistic components in the underlying process, it is possible for the same x → {\displaystyle {\vec {x}}} to generate different y {\displaystyle y} . As a result, the goal of the learning problem is to minimize expected loss (also known as the risk), defined as
I [ f ] = ∫ X × Y V ( f ( x → ) , y ) p ( x → , y ) d x → d y {\displaystyle I[f]=\displaystyle \int _{{\mathcal {X}}\times {\mathcal {Y}}}V(f({\vec {x}}),y)\,p({\vec {x}},y)\,d{\vec {x}}\,dy}
where V ( f ( x → ) , y ) {\displaystyle V(f({\vec {x}}),y)} is a given loss function, and p ( x → , y ) {\displaystyle p({\vec {x}},y)} is the probability density function of the process that generated the data, which can equivalently be written as
p ( x → , y ) = p ( y ∣ x → ) p ( x → ) . {\displaystyle p({\vec {x}},y)=p(y\mid {\vec {x}})p({\vec {x}}).}
Within classification, several commonly used loss functions are written solely in terms of the product of the true label y {\displaystyle y} and the predicted label f ( x → ) {\displaystyle f({\vec {x}})} . Therefore, they can be defined as functions of only one variable υ = y f ( x → ) {\displaystyle \upsilon =yf({\vec {x}})} , so that V ( f ( x → ) , y ) = ϕ ( y f ( x → ) ) = ϕ ( υ ) {\displaystyle V(f({\vec {x}}),y)=\phi (yf({\vec {x}}))=\phi (\upsilon )} with a suitably chosen function ϕ : R → R {\displaystyle \phi :\mathbb {R} \to \mathbb {R} } . These are called margin-based loss functions. Choosing a margin-based loss function amounts to choosing ϕ {\displaystyle \phi } . Selection of a loss function within this framework impacts the optimal f ϕ ∗ {\displaystyle f_{\phi }^{*}} which minimizes the expected risk, see empirical risk minimization. In the case of binary classification, it is possible to simplify the calculation of expected risk from the integral specified above. Specifically,
… excerpt ends here. Continue reading the full article.



