org.apache.spark.mllib.optimization
Compute the gradient and loss given features of a single data point.
Compute the gradient and loss given features of a single data point.
- Feature values for one data point. Column matrix of size nx1 where n is the number of features.
- Label for this data item.
- Column matrix containing weights for every feature.
A tuple of 2 elements. The first element is a column matrix containing the computed gradient and the second element is the loss computed at this data point.
Compute gradient and loss for a Hinge loss function. NOTE: This assumes that the labels are {0,1}