Compute the gradient and loss given the features of a single data point, add the gradient to a provided DenseVector[Double] 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 DenseVector[Double] 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 DenseVector[Double]
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: DenseVector[Double], loss: Double)
Compute gradient and loss for a Hinge loss function, as used in SVM binary classification. NOTE: This assumes that the labels are {0,1}