0
我試圖做一些與此問題非常相似的事情: How to initialize cluster centers for K-means in Spark MLlib? 但是,我並不完全瞭解該解決方案。當我嘗試加入更多的重心,我得到一個錯誤:在Spark中初始化羣集中心
Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: mismatched cluster count
我用
val initialModel = new KMeansModel(
Array("[0.6, 0.6, 5.0]", "[8.0, 8.0, 1.0]", "[11, 9.0, 7.0]").map(Vectors.parse(_))
)
val model = new KMeans()
.setInitialModel(initialModel)
.setK(3)
.run(data)
的可能的複製[如何初始化在星火MLlib K-均值聚類中心?(http://stackoverflow.com/questions/35426240/how-to-initialize-cluster-centers-for-k -means功能於火花mllib) – gsamaras