Skip to content

k-means / role of 'nstart'

2 messages · Charles Raux, Brian Ripley

#
Hello,
the k-means {stats} help and the Hartigan&Won paper say nothing about 
the way random sets works (parameter nstart). I would expect to get 
the different results for each random initial set but I always obtain 
only one result: how is it selected?
Charles Raux
#
On Fri, 2 Dec 2005, Charles Raux wrote:

            
The code works as documented.  It tries 'nstart' random starts, 
but reports (as it says)

      The data given by 'x' is clustered by the k-means method, which
      aims to partition the points into k groups such that the sum of
      squares from points to the assigned cluster centres is minimized.

that is the clustering with the smallest value of the criterion.

You could just read the code for the details.