FindNumberK: Automatic estimation of the number of clusters

View source: R/KmeansAutoElbow.R

FindNumberKR Documentation

Automatic estimation of the number of clusters

Description

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

Usage

FindNumberK(features, Kmax, StopCriteria = 0.99, graph = FALSE)

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

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 May 29, 2024, 5:23 a.m.