[R] kmeans clustering

Ko-Kang Kevin Wang kwan022 at stat.auckland.ac.nz
Mon Apr 14 14:06:32 CEST 2003


Hi,                                                                                                                                 
                                                                                                                                    
It is expected!  If you read:                                                                                                       
  ?kmeans                                                                                                                           
For the "centers" argument:                                                                                                         
"...a random set of rows in `x' are chosen                                                                                          
          as the initial centers. "                                                                                                 
                                                                                                                                    
In other words the starting values are different.  In fact one should run                                                           
kmeans() several times to avoid local minimum.                                                                                       
                                               
If you run it, say, 20 times and you get the same results 15 times, then 
you can "probably" be confident to use that solution.

On Mon, 14 Apr 2003, pingzhao wrote:

> Does any one tell me why the results are very different with the same 
> dataset and parameters when I run some times this command 
> 'kmeans(data,3,20)'???
> 
> Thank you for your help in advance!
> 
> ping
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

-- 
Cheers,

Kevin

------------------------------------------------------------------------------
/* Time is the greatest teacher, unfortunately it kills its students */

--
Ko-Kang Kevin Wang
Master of Science (MSc) Student
SLC Tutor and Lab Demonstrator
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022
Ph: 373-7599
    x88475 (City)
    x88480 (Tamaki)



More information about the R-help mailing list