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.
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.
features for one data point
label for this data point
weights/coefficients corresponding to features
the computed gradient will be added to this vector
loss
Compute the gradient and loss given the features of a single data point.
Compute the gradient and loss given the features of a single data point.
features for one data point
label for this data point
weights/coefficients corresponding to features
(gradient: Vector, loss: Double)
:: DeveloperApi :: Compute gradient and loss for a Hinge loss function, as used in SVM binary classification. See also the documentation for the precise formulation.
This assumes that the labels are {0,1}