reAssign | R Documentation |
k
-Means ClusteringRe-assign the observations,
which are trimmed in the trimmed k
-means algorithm,
back to the closest cluster as determined by the smallest
Mahalanobis distance.
reAssign(x, ...)
## S3 method for class 'tkmeans'
reAssign(x, ...)
x |
a tkmeans object |
... |
potential parameters, currently not in use. |
Given the tkmeans input, the mahalanobis distance is computed between each trimmed observation and each cluster. Each trimmed observation is assigned to the closest cluster (i.e., with the smallest Mahalanobis distance).
Function reAssign.tkmeans returns an 'reAssign_tkmeans'
object,
which inherits from tkmeans class.
Either kmeans or tkmeans is slow for big x
.
library(tclust)
data(geyser2)
clus = tkmeans(geyser2, k = 3L, alpha = .03)
plot(clus, main = 'Before Re-Assigning')
plot(reAssign(clus), main = 'After Re-Assigning')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.