public class ExpectationAggregator
extends Object
implements scala.Serializable
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.
Constructor and Description |
---|
ExpectationAggregator(int numFeatures,
Broadcast<double[]> bcWeights,
Broadcast<scala.Tuple2<DenseVector,DenseVector>[]> bcGaussians) |
Modifier and Type | Method and Description |
---|---|
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.
|
long |
count() |
DenseVector[] |
covs() |
double |
logLikelihood() |
DenseVector[] |
means() |
double[] |
weights() |
public ExpectationAggregator(int numFeatures, Broadcast<double[]> bcWeights, Broadcast<scala.Tuple2<DenseVector,DenseVector>[]> bcGaussians)
public ExpectationAggregator add(scala.Tuple2<Vector,Object> instance)
instance
- The instance of data point to be added.public long count()
public DenseVector[] covs()
public double logLikelihood()
public DenseVector[] means()
public double[] weights()