Ich versuche, etwas sehr ähnlich zu dieser Frage zu tun: How to initialize cluster centers for K-means in Spark MLlib? Allerdings verstehe ich nicht vollständig die Lösung. Wenn ich versuche, mehr Centroide hinzuzufügen, ich einen Fehler:Initialisieren Cluster Centers in Spark
Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: mismatched cluster count
Ich benutze
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)
Mögliches Duplikat von [Wie Clusterzentren für K-Mittel in Funken MLlib initialisieren?] (Http://stackoverflow.com/questions/35426240/how-to-initialize-cluster-centers-for-k -Mittel-in-Spark-MLLLIB) – gsamaras