Class ExpectationAggregator

Object
org.apache.spark.ml.clustering.ExpectationAggregator
All Implemented Interfaces:
Serializable, scala.Serializable

public class ExpectationAggregator extends Object implements scala.Serializable
ExpectationAggregator computes the partial expectation results.

param: numFeatures The number of features. param: bcWeights The broadcast weights for each Gaussian distribution in the mixture. param: bcGaussians The broadcast array of Multivariate Gaussian (Normal) Distribution in the mixture. Note only upper triangular part of the covariance matrix of each distribution is stored as dense vector (column major) in order to reduce shuffled data size.

See Also:
  • Constructor Details

  • Method Details

    • add

      public ExpectationAggregator add(scala.Tuple2<Vector,Object> instance)
      Add a new training instance to this ExpectationAggregator, update the weights, means and covariances for each distributions, and update the log likelihood.

      Parameters:
      instance - The instance of data point to be added.
      Returns:
      This ExpectationAggregator object.
    • count

      public long count()
    • covs

      public DenseVector[] covs()
    • logLikelihood

      public double logLikelihood()
    • means

      public DenseVector[] means()
    • weights

      public double[] weights()