Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

calinhara

Calinski-Harabasz index


Description

Calinski-Harabasz index for estimating the number of clusters, based on an observations/variables-matrix here. A distance based version is available through cluster.stats.

Usage

calinhara(x,clustering,cn=max(clustering))

Arguments

x

data matrix or data frame.

clustering

vector of integers. Clustering.

cn

integer. Number of clusters.

Value

Calinski-Harabasz statistic, which is (n-cn)*sum(diag(B))/((cn-1)*sum(diag(W))). B being the between-cluster means, and W being the within-clusters covariance matrix.

Author(s)

References

Calinski, T., and Harabasz, J. (1974) A Dendrite Method for Cluster Analysis, Communications in Statistics, 3, 1-27.

See Also

Examples

set.seed(98765)
  iriss <- iris[sample(150,20),-5]
  km <- kmeans(iriss,3)
  round(calinhara(iriss,km$cluster),digits=2)

fpc

Flexible Procedures for Clustering

v2.2-9
GPL
Authors
Christian Hennig <christian.hennig@unibo.it>
Initial release
2020-12-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.