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 2022/02/16 16:58:07 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #35457: [SPARK-36553][ML] KMeans avoid compute auxiliary statistics for large K

dongjoon-hyun commented on a change in pull request #35457:
URL: https://github.com/apache/spark/pull/35457#discussion_r808236586



##########
File path: mllib/src/main/scala/org/apache/spark/mllib/clustering/DistanceMeasure.scala
##########
@@ -117,6 +117,17 @@ private[spark] abstract class DistanceMeasure extends Serializable {
     packedValues
   }
 
+  def findClosest(
+      centers: Array[VectorWithNorm],
+      statistics: Option[Array[Double]],
+      point: VectorWithNorm): (Int, Double) = {
+    if (statistics.nonEmpty) {
+      findClosest(centers, statistics.get, point)
+    } else {
+      findClosest(centers, point)
+    }
+  }

Review comment:
       Shall we add the function description like the other existing `def findClosest` functions?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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