distortionMin: Distortion Minimization via K-means

Description Usage Arguments Details Value References See Also Examples

View source: R/distortionMin.R

Description

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

Usage

1
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

diffusionKmeans()

Examples

1
2
3
4
5
6
7
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 documentation built on Sept. 11, 2019, 1:04 a.m.