FindNumberK: Automatic estimation of the number of clusters

Description Usage Arguments Details Value Examples

View source: R/KmeansAutoElbow.R

Description

Compute gap on a similarity matrix obtained from raw data matrix to estimate the number of clusters automatically.

Usage

1
FindNumberK(features, Kmax, StopCriteria = 0.99, graph = F)

Arguments

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.

Details

FindNumberK return K number according spectral gap on reduced points

Value

K number of clusters obtained.

Examples

1
2
3
4
5
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)

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