zhengruifeng commented on a change in pull request #35457:
URL: https://github.com/apache/spark/pull/35457#discussion_r811642211
##########
File path: mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeans.scala
##########
@@ -269,15 +269,22 @@ class KMeans private (
instr.foreach(_.logNumFeatures(numFeatures))
- val shouldDistributed = centers.length * centers.length *
numFeatures.toLong > 1000000L
+ val shouldComputeStats =
+ DistanceMeasure.shouldComputeStatistics(centers.length)
+ val shouldComputeStatsLocally =
+ DistanceMeasure.shouldComputeStatisticsLocally(centers.length,
numFeatures)
// Execute iterations of Lloyd's algorithm until converged
while (iteration < maxIterations && !converged) {
val bcCenters = sc.broadcast(centers)
- val stats = if (shouldDistributed) {
Review comment:
previous stats is a Array[Double]
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]