Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/14948#discussion_r77435330
--- Diff:
mllib/src/test/scala/org/apache/spark/mllib/clustering/KMeansSuite.scala ---
@@ -75,7 +75,7 @@ class KMeansSuite extends SparkFunSuite with
MLlibTestSparkContext {
// Make sure code runs.
var model = KMeans.train(data, k = 2, maxIterations = 1)
- assert(model.clusterCenters.size === 2)
+ assert(model.clusterCenters.size === 1)
--- End diff --
The optimization above that returns early if # centers <= k causes this
behavior change. I think the new behavior is more correct, because before you
could get duplicate centers.
This actually fixed SPARK-3261 too
---
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]