shrinking: Data Sharpening Based on K-nearest Neighbors

Description Usage Arguments Details Value Examples

View source: R/shrinking.R

Description

Data sharpening based on K-nearest neighbors.

Usage

1
shrinking(y, K, disMethod = "Euclidean", eps = 1e-04, itmax = 20)

Arguments

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.

Details

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.

Value

Sharpened data set.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
    # Maronna data set
    data(Maronna)
    # data matrix
    maronna <- Maronna$maronna

    # cluster membership
    maronna.mem <- Maronna$maronna.mem

    tt <- shrinking(maronna, K = 5, itmax=1)
    plotClusters(tt, maronna.mem)

clues documentation built on Dec. 4, 2019, 1:09 a.m.