View source: R/KmeansAutoElbow.R
FindNumberK | R Documentation |
Compute gap on a similarity matrix obtained from raw data matrix to estimate the number of clusters automatically.
FindNumberK(features, Kmax, StopCriteria = 0.99, graph = FALSE)
features |
matrix of raw data (point by line). |
Kmax |
maximum number of clusters. |
StopCriteria |
elbow method cumulative explained variance > criteria to stop K-search. |
graph |
boolean: if TRUE, figures for total of within-class inertia and explained variance are plotted. |
FindNumberK return K number according spectral gap on reduced points
K number of clusters obtained.
dat <- rbind(matrix(rnorm(100, mean = 0, sd = 0.3), ncol = 2),
matrix(rnorm(100, mean = 2, sd = 0.3), ncol = 2),
matrix(rnorm(100, mean = 4, sd = 0.3), ncol = 2))
res <- FindNumberK(dat, Kmax=20, graph=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.