shrinking {clues} | R Documentation |
Data sharpening based on K-nearest neighbors.
shrinking(y, K, disMethod = "Euclidean", eps = 1e-04, itmax = 20)
y |
data matrix with rows being the observations and columns being variables. |
K |
number of nearest neighbors. |
disMethod |
specification of the dissimilarity measure. The available measures are “Euclidean” and “1-corr”. |
eps |
a small positive number. A value is regarded as zero if it is
less than eps . |
itmax |
maximum number of iterations allowed. |
Within each iteration, each data point is replaced by the vector of the coordinate-wise medians of its K
nearest neighbors. Data points will
move toward the locally most dense data point by this shrinking process.
Sharpened data set.
# ruspini data data(Ruspini) # data matrix ruspini <- Ruspini$ruspini tt <- shrinking(ruspini, K = 25) tt2 <- clustering(tt) plotClusters(ruspini, tt2$mem)