initial.Centers {clusterSim}R Documentation

Calculation of initial clusters centers for k-means like alghoritms

Description

Function calculates initial clusters centers for k-means like alghoritms with the following alghoritm (similar to SPSS QuickCluster function)

(a) if the distance between xkx_k and its closest cluster center is greater than the distance between the two closest centers (MmM_m and MnM_n ), then xkx_k replaces either MmM_m or MnM_n, whichever is closer to xkx_k.

(b) If xkx_k does not replace a cluster initial center in (a), a second test is made: If that distance dqd_q greater than the distance between MqM_q and its closest MiM_i, then xkx_k replaces MqM_q.

where:

MiM_i - initial center of i-th cluster

xkx_k - vector of k-th observation

d(...,...)d(...,...) - Euclidean distance

dmnd_{mn} = minijd(Mi,Mj)min_{ij} d(M_i,M_j)

dq=minid(xk,Mi)d_q = min_i d(x_k,M_i)

Usage

initial.Centers(x, k)

Arguments

x

matrix or dataset

k

number of initial cluster centers

Value

Numbers of objects choosen as initial cluster centers

Author(s)

Marek Walesiak marek.walesiak@ue.wroc.pl, Andrzej Dudek andrzej.dudek@ue.wroc.pl

Department of Econometrics and Computer Science, University of Economics, Wroclaw, Poland

References

Hartigan, J. (1975), Clustering algorithms, Wiley, New York. ISBN 0-471-35645-X.

See Also

cluster.Sim

Examples

#Example 1 (numbers of objects choosen as initial cluster centers)
library(clusterSim)
data(data_ratio)
ic <- initial.Centers(data_ratio, 10)
print(ic)

#Example 2 (application with kmeans algorithm)
library(clusterSim)
data(data_ratio)
kmeans(data_ratio,data_ratio[initial.Centers(data_ratio, 10),]) 


[Package clusterSim version 0.51-4 Index]