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 Least-squared loss function, as used in LS SVM. This is correct for the averaged least squares loss function (mean squared error) L = 1/2 (1 - y * weights dot x)**2 See also the documentation for the precise formulation.