ChooseK: Choose the Number of Clusters K for (Sparse) Weighted K-Means...

View source: R/ChooseK.R

ChooseKR Documentation

Choose the Number of Clusters K for (Sparse) Weighted K-Means Clustering

Description

The number of clusters K should be determined before the clustering method is performed. A permutation approach using Gap Statistic is used.

Usage

ChooseK(x, nClusters = 2:6, nperms = 20, nstart = 20)

## S3 method for class 'ChooseK'
plot(x, ...)

Arguments

x

An n by p numeric data matrix, and n is the number of observations and p the number of features.

nClusters

a candidate sequence of K. Default is 2:6.

nperms

Number of permutations. Default is 20.

nstart

The number of initial random sets chosen from (distinct) rows in x. Omitted if centers is provided. Default is 20.

...

unused.

Value

The function returns a list of the following components:

OptimalK

The optimal number of clusters chosen from nClusters.

plotinfo

A list containing the information needed in S3 method plot.

Methods (by generic)

  • plot: plot the Gap statistic of each candicate number of clusters K.

Author(s)

Wenyu Zhang

References

Robert, T. et al. (2001). Estimating the number of clusters in a data set via the gap statistic. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 63(2), 411-423.

See Also

Other sparse weighted K-Means functions: KMeansSparseCluster.permute.weight, KMeansSparseCluster.weight, kmeans.weight.tune, kmeans.weight


cuhklinlab/SWKM documentation built on Aug. 5, 2022, 2:27 a.m.