Picks k random starting points from given dataset to initialise k clusters. Then, one by one, the point not yet assigned to any cluster that is closest to an already assigned point is assigned to that cluster, until all points are assigned. This is called stupid nearest neighbour clustering in Hennig (2017).
stupidknn(d,k)
dist
-object or dissimilarity matrix.
integer. Number of clusters.
The clustering vector (values 1 to k
, length number of objects
behind d
),
Hennig, C. (2017) Cluster validation by measurement of clustering characteristics relevant to the user. In C. H. Skiadas (ed.) Proceedings of ASMDA 2017, 501-520, https://arxiv.org/abs/1703.09282
# NOT RUN {
set.seed(20000)
options(digits=3)
face <- rFace(200,dMoNo=2,dNoEy=0,p=2)
stupidknn(dist(face),3)
# }
Run the code above in your browser using DataLab