fuzzyclust.validity#

Cluster validity indices and model-order (number of clusters) selection.

All index functions share the signature index(X, U, V, m=2.0) where

  • X is the data matrix \(\mathbf{X}\) of shape (n_samples, n_features),

  • U the fuzzy partition \(\mathbf{U}^T\) of shape (n_samples, n_clusters),

  • V the prototypes \(\mathbf{V}\) of shape (n_clusters, n_features),

  • m the fuzziness exponent used by the clustering algorithm.

Indices that need only the partition (PC, CE, MPC) ignore X and V; indices that evaluate crisp clusters (DI, ADI, silhouette) harden the partition first. Distances between data and prototypes are Euclidean, which is the common convention in the validity literature; algorithm specific norms are therefore not used here.

Two further groups of tools live here: external comparisons of two fuzzy partitions (the fuzzy Rand, adjusted Rand and Jaccard indices of Hüllermeier et al. and of Campello) and the stability-based selection of the number of clusters (Ben-Hur et al.; Lange et al.), which resamples the data and asks for which n_clusters the partitions agree.

Validity indices and the selection of the number of clusters.

Functions#

partition_coefficient(X, U[, V, m])

Partition coefficient (Bezdek).

classification_entropy(X, U[, V, m])

Classification (partition) entropy (Bezdek).

modified_partition_coefficient(X, U[, V, m])

Modified partition coefficient (Davé, 1996).

partition_index(X, U, V[, m])

Partition index SC (Bensaid et al., 1996).

separation_index(X, U, V[, m])

Separation index S: Xie--Beni in its original form, with squared memberships (Xie and Beni, 1991).

xie_beni(X, U, V[, m])

Xie–Beni index (Xie & Beni, 1991).

fukuyama_sugeno(X, U, V[, m])

Fukuyama–Sugeno index (1989).

dunn_index(X, U[, V, m])

Dunn's index (1974) on the hardened partition.

alternative_dunn_index(X, U, V[, m])

Alternative Dunn index (ADI) of the MATLAB toolbox.

silhouette(X, U[, V, m])

Mean silhouette coefficient (Rousseeuw, 1987) of the hardened partition.

fuzzy_hypervolume(X, U, V[, m])

Fuzzy hypervolume \(FHV = \sum_i \sqrt{\det\mathbf{F}_i}\) (Gath & Geva, 1989).

partition_density(X, U, V[, m])

Partition density \(PD = \sum_i S_i / FHV\) (Gath & Geva, 1989).

average_partition_density(X, U, V[, m])

Average partition density (Gath & Geva).

pbmf_index(X, U, V[, m])

PBM-F index (Pakhira, Bandyopadhyay & Maulik, 2004).

kwon_index(X, U, V[, m])

Kwon's index (1998).

pcaes_index(X, U, V[, m])

Partition coefficient and exponential separation, PCAES (Wu & Yang, 2005).

fuzzy_rand_index(U1, U2[, method, tnorm])

Fuzzy Rand index between two fuzzy partitions of the same samples.

fuzzy_adjusted_rand_index(U1, U2[, method, ...])

Fuzzy adjusted Rand index (chance-corrected), from the fuzzy pair counts of fuzzy_rand_index().

fuzzy_jaccard_index(U1, U2[, method, tnorm])

Fuzzy Jaccard index \(a/(a+b+c)\) from the fuzzy pair counts of fuzzy_rand_index().

stability_selection(estimator, X[, ...])

Stability of the partition against resampling, for every number of clusters.

validity_indices(X, U, V[, m, indices])

Evaluate several validity indices at once.

scan_n_clusters(estimator, X[, ...])

Fit the estimator for several numbers of clusters and tabulate validity indices.

suggest_n_clusters(table)

Optimal number of clusters suggested by every index of a scan table.

Constants#

INDEX_DIRECTION

For every index: "max" if the best partition maximizes it, "min" otherwise.