Package org.apache.spark.mllib.tree.loss
Class SquaredError
Object
org.apache.spark.mllib.tree.loss.SquaredError
Class for squared error loss calculation.
 
The squared (L2) error is defined as: (y - F(x))**2 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 squares error calculation.
- 
Constructor Details- 
SquaredErrorpublic SquaredError()
 
- 
- 
Method Details- 
gradientpublic static double gradient(double prediction, double label) Method to calculate the gradients for the gradient boosting calculation for least squares error calculation. The gradient with respect to F(x) is: - 2 (y - F(x))- Parameters:
- prediction- Predicted label.
- label- True label.
- Returns:
- Loss gradient
 
 
-