Package org.apache.spark.mllib.tree.loss
Class AbsoluteError
Object
org.apache.spark.mllib.tree.loss.AbsoluteError
Class for absolute error loss calculation (for regression).
 
The absolute (L1) error is defined as: |y - F(x)| where y is the label and F(x) is the model prediction for features x.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic doublegradient(double prediction, double label) Method to calculate the gradients for the gradient boosting calculation for least absolute error calculation.
- 
Constructor Details- 
AbsoluteErrorpublic AbsoluteError()
 
- 
- 
Method Details- 
gradientpublic static double gradient(double prediction, double label) Method to calculate the gradients for the gradient boosting calculation for least absolute error calculation. The gradient with respect to F(x) is: sign(F(x) - y)- Parameters:
- prediction- Predicted label.
- label- True label.
- Returns:
- Loss gradient
 
 
-