VonLuxburgSC: Spectral Clustering based on the Von Luxburg algorithm

Description Usage Arguments Value Author(s) References Examples

View source: R/VonLuxburgSC.R

Description

The function, for a given similarity matrix, will separate the data using a spectral space. It uses the Von Luxburg algorithm to do this

Usage

1
VonLuxburgSC(W, K = 5, flagDiagZero = FALSE, verbose = FALSE)

Arguments

W

Gram Similarity Matrix.

K

number of cluster to obtain.

flagDiagZero

if True, Put zero on the similarity matrix W.

verbose

To output the verbose in the terminal.

Value

returns a list containing the following elements:

Author(s)

Emilie Poisson Caillault and Erwan Vincent

References

Von Luxburg, U. (2007). A Tutorial on Spectral Clustering. Statistics and Computing, Volume 17(4), pages 395-416

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
### Example 1: 2 disks of the same size
n<-100 ; r1<-1
x<-(runif(n)-0.5)*2;
y<-(runif(n)-0.5)*2
keep1<-which((x*2+y*2)<(r1*2))
disk1<-data.frame(x+3*r1,y)[keep1,]
disk2 <-data.frame(x-3*r1,y)[keep1,]
sameTwoDisks <- rbind(disk1,disk2)
W <- compute.similarity.ZP(scale(sameTwoDisks))
res <- VonLuxburgSC(W,K=2,flagDiagZero=TRUE,verbose=TRUE)
plot(sameTwoDisks, col = res$cluster)
plot(res$eigenVect[,1:2], col = res$cluster, main="spectral space",
     xlim=c(-1,1),ylim=c(-1,1)); points(0,0,pch='+');
plot(res$eigenVal, main="Laplacian eigenvalues",pch='+'); 

### Example 2: Speed and Stopping Distances of Cars
W <- compute.similarity.ZP(scale(iris[,-5]))
res <- VonLuxburgSC(W,K=2,flagDiagZero=TRUE,verbose=TRUE)
plot(iris, col = res$cluster)
plot(res$eigenVect[,1:2], col = res$cluster, main="spectral space",
     xlim=c(-1,1),ylim=c(-1,1)); points(0,0,pch='+');
plot(res$eigenVal, main="Laplacian eigenvalues",pch='+'); 

sClust documentation built on Aug. 24, 2021, 1:06 a.m.

Related to VonLuxburgSC in sClust...