public class LogisticLoss extends Object implements LossC
Constructor and Description |
---|
LogisticLoss() |
Modifier and Type | Method and Description |
---|---|
static CategoricalResults |
classify(double score) |
LogisticLoss |
clone() |
static double |
deriv(double pred,
double y)
Computes the first derivative of the logistic loss
|
static double |
deriv2(double pred,
double y)
Computes the second derivative of the logistic loss
|
CategoricalResults |
getClassification(double score)
Given the score value of a data point, this returns the classification
results.
|
double |
getDeriv(double pred,
double y)
Computes the first derivative of the getLoss function.
|
double |
getDeriv2(double pred,
double y)
Computes the second derivative of the getLoss function.
|
double |
getDeriv2Max()
Returns an upper bound on the maximum value of the second derivative.
|
double |
getLoss(double pred,
double y)
Computes the getLoss for a classification problem.
|
static double |
loss(double pred,
double y)
Computes the logistic loss
|
public static double loss(double pred, double y)
pred
- the predicted valuey
- the true valuepublic static double deriv(double pred, double y)
pred
- the predicted valuey
- the true valuepublic static double deriv2(double pred, double y)
pred
- the predicted valuey
- the true valuepublic static CategoricalResults classify(double score)
public double getLoss(double pred, double y)
LossC
public double getDeriv(double pred, double y)
LossC
public double getDeriv2(double pred, double y)
LossC
public double getDeriv2Max()
LossFunc
Double.NaN
is a valid
result. It is also possible for 0
and
Double.POSITIVE_INFINITY
to be valid results, and must be checked
for.getDeriv2Max
in interface LossFunc
LossFunc.getDeriv2(double, double)
public LogisticLoss clone()
public CategoricalResults getClassification(double score)
LossC
getClassification
in interface LossC
score
- the score for a data pointCopyright © 2017. All rights reserved.