Skip to content

Metrics 0.2.0 clustering

github-actions[bot] edited this page Aug 16, 2026 · 1 revision

Lodestar.Metrics 0.2.0. This page is frozen at that release. Read the current documentation for what main says now. A link to a decision or a migration page follows main, and leaves the archive.

Clustering metrics — Lodestar.Metrics

You clustered some samples and you have a reference partition to compare against — labels from a human, from an earlier model, or from a dataset that came with them. Every type on this page scores how well the two partitions agree, and none of them cares what the clusters are called: swapping the names of two clusters changes nothing, which is exactly what separates these from the classification metrics.

They disagree on what "agree" means, and the disagreement is the reason there are five.

  • Corrected for chance or not. Split every sample into a cluster of its own and Homogeneity scores a perfect 1, because every cluster does hold one class. AdjustedRand scores 0 on the same input, because that is what random labelling achieves. When a clustering looks suspiciously good, this is the pair to read together.
  • Symmetric or not. Homogeneity and Completeness are the same measurement with the two labellings exchanged, and they pull in opposite directions: splitting raises one and merging raises the other. VMeasure is their harmonic mean, for when you want one number.

The degenerate cases answer surprisingly, and it is deliberate. An empty input scores 1 on every metric here — agreeing about nothing is agreeing — and so does a single sample. Two independent partitions of four samples score -0.5 on AdjustedRand, not 0: the correction for chance is a subtraction, and it can go below zero. Every one of those numbers is scikit-learn's, measured against 1.9.0 and frozen in the oracle corpus rather than reasoned about.

Type What it measures
AdjustedRand How many pairs of samples the two partitions agree about, minus what chance would give.
Completeness Whether every sample of one class landed in the same cluster.
Homogeneity Whether each cluster holds samples of a single class.
Silhouette How well each sample sits in its own cluster rather than the nearest other one — no reference partition needed.
NormalizedMutualInformation How much knowing one labelling tells you about the other, scaled into [0, 1].
VMeasure Homogeneity and completeness as one number, their harmonic mean.

Lodestar

Project

Clone this wiki locally