View source: R/RoughClustering.r
HardKMeans | R Documentation |
HardKMeans performs classic (hard) k-means.
HardKMeans(dataMatrix, meansMatrix, nClusters, maxIterations)
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. |
$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.
M. Goetz, G. Peters, Y. Richter, D. Sacker, T. Wochinger.
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>.
# An illustrative example clustering the sample data set DemoDataC2D2a.txt
HardKMeans(DemoDataC2D2a, 2, 2, 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.