KMeansModel only returns the "cluster centroids". To get the # of elements in each cluster, try calling kmeans.predict() on each of the points in the data used to build the model. See https://github.com/OryxProject/oryx/blob/master/oryx-app-mllib/src/main/java/com/cloudera/oryx/app/mllib/kmeans/KMeansUpdate.java
Look at method fetchClusterCountsFromModel() From: Harini Srinivasan <har...@us.ibm.com> To: user@spark.apache.org Sent: Wednesday, February 11, 2015 12:36 PM Subject: getting the cluster elements from kmeans run Hi, Is there a way to get the elements ofeach cluster after running kmeans clustering? I am using the Java version. ------------------------------------------------ thanks