Github user feynmanliang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7166#discussion_r34108359
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixture.scala ---
    @@ -171,14 +185,30 @@ class GaussianMixture private (
           // Create new distributions based on the partial assignments
           // (often referred to as the "M" step in literature)
           val sumWeights = sums.weights.sum
    -      var i = 0
    -      while (i < k) {
    -        val mu = sums.means(i) / sums.weights(i)
    -        BLAS.syr(-sums.weights(i), Vectors.fromBreeze(mu),
    -          Matrices.fromBreeze(sums.sigmas(i)).asInstanceOf[DenseMatrix])
    -        weights(i) = sums.weights(i) / sumWeights
    -        gaussians(i) = new MultivariateGaussian(mu, sums.sigmas(i) / 
sums.weights(i))
    -        i = i + 1
    +
    +      if (distributeGaussians) {
    +        val (ws, gs) = sc.parallelize(0 until k).map { i =>
    --- End diff --
    
    OK.


---
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]

Reply via email to