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 of DifferentiableLossAggregator. Classes that subclass this type need to use this parameter to specify the concrete type of the aggregator.
All Superinterfaces:
Serializable, scala.Serializable

public interface DifferentiableLossAggregator<Datum,Agg extends DifferentiableLossAggregator<Datum,Agg>> extends scala.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 Type
    Method
    Description
    add(Datum instance)
    Add a single data point to this aggregator.
    int
    dim()
    The dimension of the gradient array.
    The current weighted averaged gradient.
    double[]
    Array of gradient values that are mutated when new instances are added to the aggregator.
    double
    The current loss value of this aggregator.
    double
     
    merge(Agg other)
    Merge two aggregators.
    double
    Weighted count of instances in this aggregator.
    double
     
  • Method Details

    • add

      Agg add(Datum instance)
      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

      Agg merge(Agg other)
      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()