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