Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

distortionMin

Distortion Minimization via K-means


Description

Runs one K-means loop based on the diffusion coordinates of a data set, beginning from an initial set of cluster centers.

Usage

distortionMin(X, phi0, K, c0, epsilon = 0.001)

Arguments

X

diffusion coordinates, each row corresponds to a data point

phi0

trivial left eigenvector of Markov matrix (stationary distribution of Markov random walk) in diffusion map construction

K

number of clusters

c0

initial cluster centers

epsilon

stopping criterion for relative change in distortion

Details

Used by diffusionKmeans().

Value

The returned value is a list with components

S

labelling from K-means loop. n-dimensional vector with integers between 1 and K

c

K geometric centroids found by K-means

D

minimum of total distortion (loss function of K-means) found in K-means run

DK

n by k matrix of squared (Euclidean) distances from each point to every centroid

References

Lafon, S., & Lee, A., (2006), IEEE Trans. Pattern Anal. and Mach. Intel., 28, 1393

See Also

Examples

data(annulus)
n = dim(annulus)[1]
D = dist(annulus) # use Euclidean distance
dmap = diffuse(D,0.03) # compute diffusion map
km = distortionMin(dmap$X,dmap$phi0,2,dmap$X[sample(n,2),])
plot(annulus,col=km$S,pch=20)
table(km$S,c(rep(1,500),rep(2,500)))

diffusionMap

Diffusion Map

v1.2.0
GPL-3
Authors
Joseph Richards [aut] (joeyrichar), Robrecht Cannoodt [aut, cre] (<https://orcid.org/0000-0003-3641-729X>, rcannood)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.