public class SquaredLoss extends Object
GenericLossFunction
The SquaredLoss
function implements 1/2 (prediction - label)^2
Constructor and Description |
---|
SquaredLoss() |
Modifier and Type | Method and Description |
---|---|
static double |
derivative(double prediction,
double label)
Calculates the derivative of the
PartialLossFunction |
static double |
loss(double prediction,
double label)
Calculates the loss depending on the label and the prediction
|
public static double loss(double prediction, double label)
prediction
- The predicted valuelabel
- The true valuepublic static double derivative(double prediction, double label)
PartialLossFunction
prediction
- The predicted valuelabel
- The true valueCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.