
Huber loss for regression tasks.
LossHuber.Rd
This loss can be used for regression with \(y \in \mathrm{R}\).
Format
S4 object.
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.- delta
(
numeric(1)
)
Numerical value greater than 0 to specify the interval around 0 for the quadratic error measuring (defaultdelta = 1
).
Details
Loss Function: $$ L(y, f(x)) = 0.5(y - f(x))^2 \ \ \mathrm{if} \ \ |y - f(x)| < d $$ $$ L(y, f(x)) = d|y - f(x)| - 0.5d^2 \ \ \mathrm{otherwise} $$ Gradient: $$ \frac{\delta}{\delta f(x)}\ L(y, f(x)) = f(x) - y \ \ \mathrm{if} \ \ |y - f(x)| < d $$ $$ \frac{\delta}{\delta f(x)}\ L(y, f(x)) = -d\mathrm{sign}(y - f(x)) \ \ \mathrm{otherwise} $$