Package org.apache.spark.ml.clustering
Class ExpectationAggregator
Object
org.apache.spark.ml.clustering.ExpectationAggregator
- All Implemented Interfaces:
Serializable
,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 Summary
ConstructorDescriptionExpectationAggregator
(int numFeatures, Broadcast<double[]> bcWeights, Broadcast<scala.Tuple2<DenseVector, DenseVector>[]> bcGaussians) -
Method Summary
-
Constructor Details
-
ExpectationAggregator
public ExpectationAggregator(int numFeatures, Broadcast<double[]> bcWeights, Broadcast<scala.Tuple2<DenseVector, DenseVector>[]> bcGaussians)
-
-
Method Details
-
add
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
-
logLikelihood
public double logLikelihood() -
means
-
weights
public double[] weights()
-