LossQuadratic: Quadratic loss for regression tasks.

LossQuadraticR Documentation

Quadratic loss for regression tasks.

Description

This loss can be used for regression with y \in \mathrm{R}.

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)) = \frac{1}{2}( y - f(x))^2

Gradient:

\frac{\delta}{\delta f(x)}\ L(y, f(x)) = f(x) - y

Initialization:

\hat{f}^{[0]}(x) = \mathrm{arg~min}{c\in\mathrm{R}}{\mathrm{arg~min}}\ \frac{1}{n}\sum\limits_{i=1}^n L\left(y^{(i)}, c\right) = \bar{y}

Usage

LossQuadratic$new()
LossQuadratic$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:
quadratic_loss = LossQuadratic$new()
quadratic_loss


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