public abstract class Gradient
extends java.lang.Object
implements scala.Serializable
Constructor and Description |
---|
Gradient() |
Modifier and Type | Method and Description |
---|---|
scala.Tuple2<Vector,java.lang.Object> |
compute(Vector data,
double label,
Vector weights)
Compute the gradient and loss given the features of a single data point.
|
abstract double |
compute(Vector data,
double label,
Vector weights,
Vector cumGradient)
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.
|
public scala.Tuple2<Vector,java.lang.Object> compute(Vector data, double label, Vector weights)
data
- features for one data pointlabel
- label for this data pointweights
- weights/coefficients corresponding to features
public abstract double compute(Vector data, double label, Vector weights, Vector cumGradient)
data
- features for one data pointlabel
- label for this data pointweights
- weights/coefficients corresponding to featurescumGradient
- the computed gradient will be added to this vector