Github user jkbradley commented on a diff in the pull request: https://github.com/apache/spark/pull/11119#discussion_r56110707 --- Diff: mllib/src/test/scala/org/apache/spark/ml/clustering/KMeansSuite.scala --- @@ -108,6 +111,21 @@ class KMeansSuite extends SparkFunSuite with MLlibTestSparkContext with DefaultR val kmeans = new KMeans() testEstimatorAndModelReadWrite(kmeans, dataset, KMeansSuite.allParamSettings, checkModelData) } + + test("Initialize using given cluster centers") { + val kmeans = new KMeans() + .setK(k) + .setSeed(1) + .setMaxIter(1000) // Set a fairly high maxIter to make sure the model is converged. --- End diff -- This sounds expensive. What if instead we did this: * a = KMeans with 1 iteration * b = KMeans with 2 iterations * c = KMeans with initialModel a, with 1 iteration * ensure b and c are equal
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org