Github user MLnick commented on the issue: https://github.com/apache/spark/pull/11119 Isn't the point of an initial model mainly the cluster centers? If you override k what happens to the cluster centers? Discard them? Why not then just start again rather than have an initial model On Sat, 8 Oct 2016 at 09:04, DB Tsai <notificati...@github.com> wrote: > *@dbtsai* commented on this pull request. > ------------------------------ > > In mllib/src/test/scala/org/apache/spark/ml/clustering/KMeansSuite.scala > <https://github.com/apache/spark/pull/11119>: > > > + assert(wrongDimModelThrown.getMessage.contains("mismatched dimension")) > + } > + > + test("Infer K from an initial model if K is unset") { > + val kmeans = new KMeans() > + val testNewK = 10 > + val randomModel = KMeansSuite.generateRandomKMeansModel(dim, testNewK) > + assert(kmeans.setInitialModel(randomModel).getK === testNewK) > + } > + > + test("Initialize using a model with wrong K if K is set") { > + val kmeans = new KMeans().setK(k).setSeed(1).setMaxIter(1) > + > + val wrongKModel = KMeansSuite.generateRandomKMeansModel(3, k + 1) > + val wrongKModelThrown = intercept[IllegalArgumentException] { > + kmeans.setInitialModel(wrongKModel).fit(dataset) > > I think the behavior could be that setInitialModel should overwrite the > configuration including # of iterations and k, etc. What do you think? > > â > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/apache/spark/pull/11119>, or mute the thread > <https://github.com/notifications/unsubscribe-auth/AA_SBz3tn7GjUrfqnCmOmrcGbi38ZG2gks5qx0BogaJpZM4HV2Td> > . >
--- 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