bipartitionShi: Spectral clustering

Description Usage Arguments Details Value References Examples

View source: R/codeSpectral.R

Description

Perform spectral clustering thanks to a similarity matrix (according to Shi and Malik, 2000).

Usage

1

Arguments

sim

similarity matrix.

Details

bipartitionShi returns a partition obtained by spectral clustering (according to Shi and Malik, 2000)

Value

The function returns a list containing:

label

vector of labels.

eigenvector

matrix containing, in columns, the eigenvectors of the similarity matrix.

eigenvalue

vector containing the eigenvalues of the similarity matrix.

References

J. Shi, J. Malik, Normalized cuts and image segmentation, IEEE Transactions on Pattern Analysis and Machine Intelligence, 2000, 22(8), 888-905.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dat <- rbind(matrix(rnorm(100, mean = 0, sd = 0.3), ncol = 2), 
           matrix(rnorm(100, mean = 2, sd = 0.3), ncol = 2))

sim <- computeGaussianSimilarity(dat, 1)
res <- bipartitionShi(sim)

plot(dat[,1], dat[,2], type = "p", xlab = "x", ylab = "y", 
col = res$label, main = "Initial features space")
plot(res$eigenvector, type = "p", xlab = "Indices", ylab = "1st eigenvector", 
col = res$label, main = "Spectral embedding")

RclusTool documentation built on Feb. 4, 2020, 5:08 p.m.