Interface DifferentiableLossAggregator<Datum,Agg extends DifferentiableLossAggregator<Datum,Agg>>
- Type Parameters:
Datum- The type of the instances added to the aggregator to update the loss and gradient.Agg- Specialization ofDifferentiableLossAggregator. Classes that subclass this type need to use this parameter to specify the concrete type of the aggregator.
- All Superinterfaces:
Serializable
public interface DifferentiableLossAggregator<Datum,Agg extends DifferentiableLossAggregator<Datum,Agg>>
extends Serializable
A parent trait for aggregators used in fitting MLlib models. This parent trait implements
some of the common code shared between concrete instances of aggregators. Subclasses of this
aggregator need only implement the
add method.
-
Method Summary
Modifier and TypeMethodDescriptionAdd a single data point to this aggregator.intdim()The dimension of the gradient array.gradient()The current weighted averaged gradient.double[]Array of gradient values that are mutated when new instances are added to the aggregator.doubleloss()The current loss value of this aggregator.doublelossSum()Merge two aggregators.doubleweight()Weighted count of instances in this aggregator.double
-
Method Details
-
add
Add a single data point to this aggregator. -
dim
int dim()The dimension of the gradient array. -
gradient
Vector gradient()The current weighted averaged gradient. -
gradientSumArray
double[] gradientSumArray()Array of gradient values that are mutated when new instances are added to the aggregator. -
loss
double loss()The current loss value of this aggregator. -
lossSum
double lossSum() -
merge
Merge two aggregators. The `this` object will be modified in place and returned. -
weight
double weight()Weighted count of instances in this aggregator. -
weightSum
double weightSum()
-