forgy | R Documentation |
Initializes the cluster prototypes using the centers that are calculated with Forgy's algorithm (Forgy, 1965), which is the earliest algorithm for seeding the clusters in the standard K-means clustering.
forgy(x, k)
x |
a numeric vector, data frame or matrix. |
k |
an integer specifying the number of clusters. |
In this algorithm, each object in the data set is randomly assigned to one of k clusters, and then the mean of the objects assigned to the clusters are used as the initial cluster prototypes. The algorithm lacks of theoretical basis, and the clusters generated randomly may have no internal homogeneity (Celebi et al, 2013).
an object of class ‘inaparc’, which is a list consists of the following items:
v |
a numeric matrix containing the initial cluster prototypes. |
ctype |
a string representing the type of centroid, which used to build prototype matrix. Its value is ‘avg’ with this function because the cluster prototypes are the averages of sampled objects for each cluster. |
call |
a string containing the matched function call that generates the object. |
Zeynel Cebeci, Cagatay Cebeci
Forgy, E.W. (1965). Cluster analysis of multivariate data: Efficiency vs interpretability of classification, Biometrics, 21 (3) : 768-769.
Celebi, M.E., Kingravi, H.A. & Vela, P.A. (2013). A comparative study of efficient initialization methods for the K-means clustering algorithm, Expert Systems with Applications, 40 (1): 200-210. arXiv:https://arxiv.org/pdf/1209.1960.pdf
aldaoud
,
ballhall
,
crsamp
,
firstk
,
hartiganwong
,
inofrep
,
inscsf
,
insdev
,
kkz
,
kmpp
,
ksegments
,
ksteps
,
lastk
,
lhsmaximin
,
lhsrandom
,
maximin
,
mscseek
,
rsamp
,
rsegment
,
scseek
,
scseek2
,
spaeth
,
ssamp
,
topbottom
,
uniquek
,
ursamp
data(iris) res <- forgy(iris[,1:4], k=5) v <- res$v print(v)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.