HardKMeans {SoftClustering} | R Documentation |
Hard k-Means
Description
HardKMeans performs classic (hard) k-means.
Usage
HardKMeans(dataMatrix, meansMatrix, nClusters, maxIterations)
Arguments
dataMatrix |
Matrix with the objects to be clustered. Dimension: [nObjects x nFeatures]. |
meansMatrix |
Select means derived from 1 = random (unity interval), 2 = maximum distances, matrix [nClusters x nFeatures] = self-defined means. Default: 2 = maximum distances. |
nClusters |
Number of clusters: Integer in [2, nObjects). Note, nCluster must be set even when meansMatrix is a matrix. For transparency, nClusters will not be overridden by the number of clusters derived from meansMatrix. Default: nClusters=2. |
maxIterations |
Maximum number of iterations. Default: maxIterations=100. |
Value
$upperApprox
: Obtained upper approximations [nObjects x nClusters]. Note: Apply function createLowerMShipMatrix()
to obtain lower approximations; and for the boundary: boundary = upperApprox - lowerApprox
.
$clusterMeans
: Obtained means [nClusters x nFeatures].
$nIterations
: Number of iterations.
Author(s)
M. Goetz, G. Peters, Y. Richter, D. Sacker, T. Wochinger.
References
Lloyd, S.P. (1982) Least squares quantization in PCM. IEEE Transactions on Information Theory 28, 128–137. <doi:10.1016/j.ijar.2012.10.003>.
Peters, G.; Crespo, F.; Lingras, P. and Weber, R. (2013) Soft clustering – fuzzy and rough approaches and their extensions and derivatives. International Journal of Approximate Reasoning 54, 307–322. <doi:10.1016/j.ijar.2012.10.003>.
Examples
# An illustrative example clustering the sample data set DemoDataC2D2a.txt
HardKMeans(DemoDataC2D2a, 2, 2, 100)