Github user feynmanliang commented on a diff in the pull request:
https://github.com/apache/spark/pull/7166#discussion_r34197267
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixture.scala ---
@@ -192,6 +209,19 @@ class GaussianMixture private (
/** Java-friendly version of [[run()]] */
def run(data: JavaRDD[Vector]): GaussianMixtureModel = run(data.rdd)
+ private def updateWeightsAndGaussians(
+ mean: BDV[Double],
+ sigma: BreezeMatrix[Double],
+ weight: Double,
+ sumWeights: Double): (Double, MultivariateGaussian) = {
+ val mu = mean / weight
+ BLAS.syr(-weight, Vectors.fromBreeze(mu),
+ Matrices.fromBreeze(sigma).asInstanceOf[DenseMatrix])
+ val newWeight = weight / sumWeights
--- End diff --
Discussed on Slack.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]