ClusterCIndex: Hubert-Levin C-Index

View source: R/ClusterCIndex.R

ClusterCIndexR Documentation

Hubert-Levin C-Index

Description

Hubert-Levin C-Index [Hubert/Levin, 1976] evaluates a hard partition without a reference classification. C-index in [0,1]; smaller values are better.

Usage

ClusterCIndex(Cls, DataOrDistances, DistanceMethod = "euclidean",
                         Silent = TRUE, ...)

Arguments

Cls

Vector of length n containing arbitrary numeric, character, or factor cluster labels. Missing labels and non-finite numeric labels are not allowed. Rows and labels are matched by position. Zero is an ordinary cluster label; remove noise observations explicitly if they should not be evaluated.

DataOrDistances

Finite numeric data matrix or data frame with n rows, a symmetric n by n dissimilarity matrix with non-negative entries and a zero diagonal, or a dist object. Matrices are recognized as dissimilarities by IsDissimilarity. A square raw-data matrix satisfying that test is therefore interpreted as distances. Each unordered pair is counted once, without self-pairs.

DistanceMethod

Distance method for feature data, passed to parallelDist::parDist() or stats::dist() if parallelDist is unavailable. Ignored for precomputed dissimilarities. Default: "euclidean".

Silent

Logical scalar. Suppresses the progress message for distance calculation when TRUE; warnings and missing-package messages remain.

...

Further arguments for parallelDist::parDist() or its stats::dist() fallback. Ignored for precomputed dissimilarities.

Details

ClusterCIndex calculates

C = \frac{S-S_{min}}{S_{max}-S_{min}}.

If m unordered pairs belong to the same cluster, S sums their distances. The minimum and maximum sums use the m smallest and m largest distances, respectively, among all unordered pairs. The index lies in [0,1] when defined.

Malformed inputs cause an error. A partition without either within-cluster or between-cluster pairs, or equal minimum and maximum sums, produces a warning and returns NaN.

Pairwise distance storage is quadratic in the number of observations. No observations are subsampled.

This function is also called by ClusterNoEstimation. The standalone function evaluates one given partition without selecting a number of clusters.

Value

List of

CIndex

C-index in [0,1]; smaller values are better.

Object

List of WithinSum, MinimumSum, MaximumSum and WithinPairCount. Invalid partitions return NULL.

Author(s)

Michael Thrun

References

[Hubert/Levin, 1976] Hubert, L. J., & Levin, J. R.: A general statistical framework for assessing categorical clustering in free recall, Psychological Bulletin, Vol. 83(6), pp. 1072-1080, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1037/0033-2909.83.6.1072")}, 1976.

See Also

ClusterNoEstimation, ClusterDunnIndex, ClusterDaviesBouldinIndex

Examples

Data = matrix(c(0, 1, 2, 10, 11, 12), ncol = 1)
Cls = rep(c(10, 20), each = 3)
V = ClusterCIndex(Cls, Data)
V$CIndex

FCPS documentation built on Nov. 28, 2026, 9:08 a.m.