You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by SK <sk...@gmail.com> on 2015/02/05 23:35:01 UTC

K-Means final cluster centers

Hi,

I am trying to get the final cluster centers after running the KMeans
algorithm in MLlib in order to characterize the clusters. But the
KMeansModel does not have any public method to retrieve this info. There
appears to be only  a private method called clusterCentersWithNorm. I guess
I could call predict() to get the final cluster assignment for the dataset
and write my own code to compute the means based on this final assignment.
But I would like to know if  there is a way to get this info from MLLib API
directly after running KMeans?

thanks 



--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/K-Means-final-cluster-centers-tp21523.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org


Re: K-Means final cluster centers

Posted by Suneel Marthi <su...@yahoo.com.INVALID>.
There's a kMeansModel.clusterCenters() available if u r looking to get the centers from KMeansModel.

      From: SK <sk...@gmail.com>
 To: user@spark.apache.org 
 Sent: Thursday, February 5, 2015 5:35 PM
 Subject: K-Means final cluster centers
   
Hi,

I am trying to get the final cluster centers after running the KMeans
algorithm in MLlib in order to characterize the clusters. But the
KMeansModel does not have any public method to retrieve this info. There
appears to be only  a private method called clusterCentersWithNorm. I guess
I could call predict() to get the final cluster assignment for the dataset
and write my own code to compute the means based on this final assignment.
But I would like to know if  there is a way to get this info from MLLib API
directly after running KMeans?

thanks 



--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/K-Means-final-cluster-centers-tp21523.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org



  

Re: K-Means final cluster centers

Posted by Frank Austin Nothaft <fn...@berkeley.edu>.
Unless I misunderstood your question, you’re looking for the val clusterCenters in http://spark.apache.org/docs/1.2.0/api/scala/index.html#org.apache.spark.mllib.clustering.KMeansModel, no?

Frank Austin Nothaft
fnothaft@berkeley.edu
fnothaft@eecs.berkeley.edu
202-340-0466

On Feb 5, 2015, at 2:35 PM, SK <sk...@gmail.com> wrote:

> Hi,
> 
> I am trying to get the final cluster centers after running the KMeans
> algorithm in MLlib in order to characterize the clusters. But the
> KMeansModel does not have any public method to retrieve this info. There
> appears to be only  a private method called clusterCentersWithNorm. I guess
> I could call predict() to get the final cluster assignment for the dataset
> and write my own code to compute the means based on this final assignment.
> But I would like to know if  there is a way to get this info from MLLib API
> directly after running KMeans?
> 
> thanks 
> 
> 
> 
> --
> View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/K-Means-final-cluster-centers-tp21523.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
> For additional commands, e-mail: user-help@spark.apache.org
>