My question is probably elementary, and I apologize for that. I am reading Kogan's "Introduction to Clustering Large and High-Dimensional Data"; I am interested in understanding batch K-means and K-means and use it in $\operatorname{R}$. In the textbook it is stated that both algorithms need an initial choice of
- the number of clusters $K$
- An initial partition of the given dataset
Using such entries, the algorithms can perform the learning exercise. Kogan states that the initial partition is usually found using a Principal Direction Divisive Partitioning (PDDP) algorithm.
Looking at the K-means function kmeans
in $\operatorname{R}$ I have noticed the absence of the initial partition as argument of the function itself. One can specify the number of clusters or a set of initial centers.
Moreover, the default K-mean algorithm used by kmeans
is the one by Hartigan and Wong (1979). Unfortunately I have no access to the original paper, and I could not run through the original code, searching for the initial partition.
My questions are:
- is there an initial partition choice hidden somewhere in
kmeans
? If yes, how is it chosen? - In absence of initial partition choice, how does
kmeans
begins to run (a high level overview would be great!)?
I thank you all.
k
randomly selected points. $\endgroup$kmeans
. Maybe I am wrong and no initial partition is used at all... $\endgroup$centers <- x[sample.int(m, k), , drop = FALSE]
) $\endgroup$