@Internal public class BinaryLogisticLoss extends Object implements LossFunc
LogisticRegression
for example.Modifier and Type | Field and Description |
---|---|
static BinaryLogisticLoss |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
void |
computeGradient(LabeledPointWithWeight dataPoint,
DenseVector coefficient,
DenseVector cumGradient)
Computes the gradient on the given data point and adds the computed gradient to cumGradient.
|
double |
computeLoss(LabeledPointWithWeight dataPoint,
DenseVector coefficient)
Computes the loss on the given data point.
|
public static final BinaryLogisticLoss INSTANCE
public double computeLoss(LabeledPointWithWeight dataPoint, DenseVector coefficient)
LossFunc
computeLoss
in interface LossFunc
dataPoint
- A training data point.coefficient
- The model parameters.public void computeGradient(LabeledPointWithWeight dataPoint, DenseVector coefficient, DenseVector cumGradient)
LossFunc
computeGradient
in interface LossFunc
dataPoint
- A training data point.coefficient
- The model parameters.cumGradient
- The accumulated gradient.Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.