You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/01/21 15:40:58 UTC

[GitHub] shahidki31 commented on a change in pull request #21627: [SPARK-24484][MLLIB]Power Iteration Clustering is giving incorrect clustering results when there are mutiple leading eigen values.

shahidki31 commented on a change in pull request #21627: [SPARK-24484][MLLIB]Power Iteration Clustering is giving incorrect clustering results when there are mutiple leading eigen values.
URL: https://github.com/apache/spark/pull/21627#discussion_r249496182
 
 

 ##########
 File path: mllib/src/main/scala/org/apache/spark/mllib/clustering/PowerIterationClustering.scala
 ##########
 @@ -378,6 +378,22 @@ object PowerIterationClustering extends Logging {
       logInfo(s"$msgPrefix: delta = $delta.")
       diffDelta = math.abs(delta - prevDelta)
       logInfo(s"$msgPrefix: diff(delta) = $diffDelta.")
+
+      if (math.abs(diffDelta) < tol) {
+        /**
+         * Power Iteration fails to converge if absolute value of top 2 eigen values are equal,
+         * but with opposite sign. The resultant vector flip-flops between two vectors.
+         * We should give an exception, if we detect the failure of the convergence of the
+         * power iteration
+         */
+        val reileigh = curG.joinVertices(v) {
 
 Review comment:
   Done.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org