LossHuber | R Documentation |
This loss can be used for regression with y \in \mathrm{R}
.
offset |
( |
delta |
( |
S4 object.
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}
LossHuber$new() LossHuber$new(delta) LossHuber$new(offset, delta)
$loss()
: matrix(), matrix() -> matrix()
$gradient()
: matrix(), matrix() -> matrix()
$constInit()
: matrix() -> matrix()
$calculatePseudoResiduals()
: matrix(), matrix() -> matrix()
$getLossType()
: () -> character(1)
# Create new loss object:
huber_loss = LossHuber$new()
huber_loss
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.