calcCalinskiHarabasz: Calinski-Harabasz index

View source: R/clustering_evaluation.R

calcCalinskiHarabaszR Documentation

Calinski-Harabasz index

Description

Calculate the Calinski-Harabasz index of clustering quality.

Usage

calcCalinskiHarabasz(data, belongmatrix, centers)

Arguments

data

The original dataframe used for the clustering (n*p)

belongmatrix

A membership matrix (n*k)

centers

The centres of the clusters

Details

The Calinski-Harabasz index \insertCiteda2020incrementalgeocmeans is the ratio between the clusters separation (between groups sum of squares) and the clusters cohesion (within groups sum of squares). A greater value indicates either more separated clusters or more cohesive clusters.

Value

A float: the Calinski-Harabasz index

References

\insertAllCited

Examples

data(LyonIris)
AnalysisFields <-c("Lden","NO2","PM25","VegHautPrt","Pct0_14","Pct_65","Pct_Img",
"TxChom1564","Pct_brevet","NivVieMed")
dataset <- sf::st_drop_geometry(LyonIris[AnalysisFields])
queen <- spdep::poly2nb(LyonIris,queen=TRUE)
Wqueen <- spdep::nb2listw(queen,style="W")
result <- SFCMeans(dataset, Wqueen,k = 5, m = 1.5, alpha = 1.5, standardize = TRUE)
calcCalinskiHarabasz(result$Data, result$Belongings, result$Centers)

geocmeans documentation built on Sept. 12, 2023, 9:06 a.m.