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(Vector 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() |
ExpectationAggregator |
merge(ExpectationAggregator other)
Merge another ExpectationAggregator, update the weights, means and covariances
for each distributions, and update the log likelihood.
|
double[] |
weights() |
public ExpectationAggregator(int numFeatures, Broadcast<double[]> bcWeights, Broadcast<scala.Tuple2<DenseVector,DenseVector>[]> bcGaussians)
public long count()
public double logLikelihood()
public double[] weights()
public DenseVector[] means()
public DenseVector[] covs()
public ExpectationAggregator add(Vector instance)
instance
- The instance of data point to be added.public ExpectationAggregator merge(ExpectationAggregator other)
this
object will be modified.)
other
- The other ExpectationAggregator to be merged.