public class HingeLoss$ extends Object implements PartialLossFunction
GenericLossFunction
The HingeLoss
function implements max(0, 1 - prediction*label)
for binary classification with label in {-1, 1}
Modifier and Type | Field and Description |
---|---|
static HingeLoss$ |
MODULE$
Static reference to the singleton instance of this Scala object.
|
Constructor and Description |
---|
HingeLoss$() |
Modifier and Type | Method and Description |
---|---|
double |
derivative(double prediction,
double label)
Calculates the derivative of the loss function with respect to the prediction
|
double |
loss(double prediction,
double label)
Calculates the loss for a given prediction/truth pair
|
public static final HingeLoss$ MODULE$
public double loss(double prediction, double label)
loss
in interface PartialLossFunction
prediction
- The predicted valuelabel
- The true valuepublic double derivative(double prediction, double label)
derivative
in interface PartialLossFunction
prediction
- The predicted valuelabel
- The true valueCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.