Skip to content



A ground-truth clustering metric that measures the ratio of samples in a cluster that are also members of the same class. A cluster is said to be homogeneous when the entire cluster is comprised of a single class of samples.

\[ {\displaystyle Homogeneity = 1-\frac{H(C, K)}{H(C)}} \]


Since this metric monotonically improves as the number of target clusters increases, it should not be used as a metric to guide hyper-parameter tuning.

Estimator Compatibility: Clusterer

Score Range: 0 to 1


This metric does not have any parameters.


use Rubix\ML\CrossValidation\Metrics\Homogeneity;

$metric = new Homogeneity();