diff --git a/docs/losses/interface.rst b/docs/losses/interface.rst index 5b6d6c0..f06f12b 100644 --- a/docs/losses/interface.rst +++ b/docs/losses/interface.rst @@ -184,8 +184,6 @@ that can be queried by functions defined in *LearnBase.jl*. .. function:: isclipable(loss) -.. function:: islipschitzcont_deriv(loss) - .. function:: ismarginbased(loss) .. function:: isclasscalibrated(loss) diff --git a/docs/losses/margin.rst b/docs/losses/margin.rst index 52d8577..c3974ea 100644 --- a/docs/losses/margin.rst +++ b/docs/losses/margin.rst @@ -8,7 +8,21 @@ that are implemented in this package. Margin-based Losses (Classification) - Note: The ZeroOneLoss itself is not margin-based +ZeroOneLoss +------------ + +.. class:: ZeroOneLoss + + The classical classification loss. It penalizes every + missclassified observation with a loss of `1` while every + correctly classified observation has a loss of `0`. + It is not convex nor continuous and thus seldomly used directly. + Instead one usually works with some classification-calibrated + surrogate loss, such as one of those listed below. + +.. math:: + + L(a) = \begin{cases} 1 & \quad \text{if } a < 0 \\ 0 & \quad \text{if } a >= 0\\ \end{cases} PerceptronLoss --------------- diff --git a/src/supervised/margin.jl b/src/supervised/margin.jl index 5977502..4c677b2 100644 --- a/src/supervised/margin.jl +++ b/src/supervised/margin.jl @@ -7,6 +7,15 @@ doc""" ZeroOneLoss <: MarginLoss +The classical classification loss. It penalizes every missclassified +observation with a loss of `1` while every correctly classified +observation has a loss of `0`. +It is not convex nor continuous and thus seldomly used directly. +Instead one usually works with some classification-calibrated +surrogate loss, such as one of those listed below. + +`L(a) = a < 0 ? 1 : 0` + Lossfunction Derivative ┌────────────┬────────────┐ ┌────────────┬────────────┐ 1 │------------┐ │ 1 │ │