fastMSC {sClust}R Documentation

Fast Multi-Level Spectral Clustering

Description

The function, for a given dataFrame, will separate the data using the Fast NJW clustering in several levels.

Usage

fastMSC(
  X,
  levelMax,
  silMin = 0.7,
  vois = 7,
  flagDiagZero = FALSE,
  method = "default",
  Kmax = 20,
  tolerence = 0.99,
  threshold = 0.7,
  minPoint = 7,
  verbose = FALSE
)

Arguments

X

The dataFrame.

levelMax

The maximum depth level.

silMin

The minimal silhouette allowed. Below this value, the cluster will be cut again.

vois

number of points that will be selected for the similarity computation.

flagDiagZero

if True, Put zero on the similarity matrix W.

method

The method that will be used. "default" to let the function choose the most suitable method. "PEV" for the Principal EigenValue method. "GAP" for the GAP method.

Kmax

The maximum number of cluster which is allowed.

tolerence

The tolerance allowed for the Principal EigenValue method.

threshold

The threshold to select the dominant eigenvalue for the GAP method.

minPoint

The minimum number of points required to compute a cluster.

verbose

To output the verbose in the terminal.

Value

a dataframe containing the results labels of each levels

Author(s)

Emilie Poisson Caillault and Erwan Vincent

Examples

### 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)
res <- fastMSC(scale(sameTwoDisks),levelMax=5, silMin=0.7, vois=7, 
           flagDiagZero=TRUE, method = "PEV", Kmax = 20, 
           tolerence = 0.99,threshold = 0.7, minPoint = 7, verbose = TRUE)
plot(sameTwoDisks, col = as.factor(res[,ncol(res)]))

### Example 2: Speed and Stopping Distances of Cars
res <- fastMSC(scale(iris[,-5]),levelMax=5, silMin=0.7, vois=7, 
           flagDiagZero=TRUE, method = "PEV", Kmax = 20, 
           tolerence = 0.99,threshold = 0.9, minPoint = 7, verbose = TRUE)
plot(iris, col = as.factor(res[,ncol(res)]))
table(res[,ncol(res)],iris$Species)

[Package sClust version 1.0 Index]