The data given by x
is clustered by an algorithm.
If centers
is a matrix, its rows are taken as the initial
cluster centers. If centers
is an integer, centers
rows
of x
are randomly chosen as initial values.
The algorithm stops, if no cluster center has changed during the last
iteration or the maximum number of iterations (given by
iter.max
) is reached.
If verbose
is TRUE
, only for "kmeans"
method,
displays for each iteration the number of the iteration and the
numbers of cluster indices which have changed since the last iteration
is given.
If dist
is "euclidean"
, the distance between the cluster
center and the data points is the Euclidian distance (ordinary kmeans
algorithm). If "manhattan"
, the distance between the cluster
center and the data points is the sum of the absolute values of the
distances of the coordinates.
If method
is "kmeans"
, then we have the kmeans
clustering method, which works by repeatedly moving all cluster
centers to the mean of their Voronoi sets. If "hardcl"
we have
the On-line Update (Hard Competitive learning) method, which works by
performing an update directly after each input signal, and if
"neuralgas"
we have the Neural Gas (Soft Competitive learning)
method, that sorts for each input signal the units of the network
according to the distance of their reference vectors to input signal.
If rate.method
is "polynomial"
, the polynomial learning
rate is used, that means \(1/t\), where \(t\) stands for the
number of input data for which a particular cluster has been the
winner so far. If "exponentially decaying"
, the exponential
decaying learning rate is used according to
\(par1*{(par2/par1)}^{(iter/itermax)}\)
where \(par1\) and \(par2\) are the initial and final values of
the learning rate.
The parameters rate.par
of the learning rate, where
if rate.method
is "polynomial"
then by default
rate.par=1.0
, otherwise rate.par=(0.5,1e-5)
.