Class HingeGradient
Object
org.apache.spark.mllib.optimization.Gradient
org.apache.spark.mllib.optimization.HingeGradient
- All Implemented Interfaces:
Serializable
Compute gradient and loss for a Hinge loss function, as used in SVM binary classification.
See also the documentation for the precise formulation.
- See Also:
- Note:
- This assumes that the labels are {0,1}
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCompute the gradient and loss given the features of a single data point.double
Compute the gradient and loss given the features of a single data point, add the gradient to a provided vector to avoid creating new objects, and return loss.
-
Constructor Details
-
HingeGradient
public HingeGradient()
-
-
Method Details
-
compute
Description copied from class:Gradient
Compute the gradient and loss given the features of a single data point. -
compute
Description copied from class:Gradient
Compute the gradient and loss given the features of a single data point, add the gradient to a provided vector to avoid creating new objects, and return loss.
-