Skip to content

calinskiHarabasz

function calinskiHarabasz(ldIn, cl): MetricResult;

Defined in: metrics/separability.ts:191

Ratio of between-class to within-class scatter.

Rewards classes that are tight and far apart. Unbounded above, so it is only meaningful when comparing projections of the same labelled dataset — the magnitude carries no absolute meaning.

  • Needs: projection only. Labels required.
  • Range: [0, ∞), higher is better.
  • Cost: O(N·D).
ParameterType
ldInPointsInput
clClusters

MetricResult

Caliński & Harabasz, Comm. Statistics 3 (1974) https://doi.org/10.1080/03610927408827101

import { clusters, calinskiHarabasz } from "@saehrimnir/sickle";
const cl = clusters(projection, labels);
calinskiHarabasz(projection, cl).value; // 4686.8502
// Unbounded: meaningless on its own, only comparable between projections of
// the same points.