LossBinomial: 0-1 Loss for binary classification derived of the binomial...

LossBinomialR Documentation

0-1 Loss for binary classification derived of the binomial distribution

Description

This loss can be used for binary classification. The coding we have chosen here acts on y \in \{-1, 1\}.

Arguments

offset

(numeric(1) | matrix())
Numerical value or matrix to set a custom offset. If used, this value is returned instead of the loss optimal initialization.

Format

S4 object.

Details

Loss Function:

L(y, f(x)) = \log(1 + \mathrm{exp}(-2yf(x)))

Gradient:

\frac{\delta}{\delta f(x)}\ L(y, f(x)) = - \frac{y}{1 + \mathrm{exp}(2yf)}

Initialization:

\hat{f}^{[0]}(x) = \frac{1}{2}\mathrm{log}(p / (1 - p))

with

p = \frac{1}{n}\sum\limits_{i=1}^n\mathrm{1}_{\{y^{(i)} = 1\}}

Usage

LossBinomial$new()
LossBinomial$new(offset)

Inherited methods from Loss

  • ⁠$loss()⁠: ⁠matrix(), matrix() -> matrix()⁠

  • ⁠$gradient()⁠: ⁠matrix(), matrix() -> matrix()⁠

  • ⁠$constInit()⁠: matrix() -> matrix()

  • ⁠$calculatePseudoResiduals()⁠: ⁠matrix(), matrix() -> matrix()⁠

  • ⁠$getLossType()⁠: ⁠() -> character(1)⁠

Examples


# Create new loss object:
bin_loss = LossBinomial$new()
bin_loss


schalkdaniel/compboost documentation built on April 15, 2023, 9:03 p.m.