Description Usage Arguments Value Author(s) Examples
View source: R/computeKclust.R
Function which select the number of cluster to compute thanks to a selected method
1 2 3 4 5 6 7 8 | compute.kclust(
eigenValues,
method = "default",
Kmax = 20,
tolerence = 1,
threshold = 0.9,
verbose = FALSE
)
|
eigenValues |
The eigenvalues of the laplacian matrix. |
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. |
verbose |
To output the verbose in the terminal. |
a vector which contain the number of cluster to compute.
Emilie Poisson Caillault and Erwan Vincent
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ### 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))
W <- checking.gram.similarityMatrix(W)
eigVal <- compute.laplacian.NJW(W,verbose = TRUE)$eigen$values
K <- compute.kclust(eigVal, method="default", Kmax=20, tolerence=0.99, threshold=0.9, verbose=TRUE)
### Example 2: Speed and Stopping Distances of Cars
W <- compute.similarity.ZP(scale(cars))
W <- checking.gram.similarityMatrix(W)
eigVal <- compute.laplacian.NJW(W,verbose = TRUE)$eigen$values
K <- compute.kclust(eigVal, method="default", Kmax=20, tolerence=0.99, threshold=0.9, verbose=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.