Skip to content

averageBetweenWithin

function averageBetweenWithin(ldIn, cl): MetricResult;

Defined in: metrics/separability.ts:302

Mean distance between classes divided by mean distance within them.

The simplest possible separation ratio.

  • Needs: projection only. Labels required.
  • Range: [0, ∞), higher is better. 1 means between- and within-class distances are alike, i.e. no separation.
  • Cost: O(N²·D).
ParameterType
ldInPointsInput
clClusters

MetricResult

import { clusters, averageBetweenWithin } from "@saehrimnir/sickle";
const cl = clusters(projection, labels);
averageBetweenWithin(projection, cl).value; // 10.7873
// 1 means between- and within-class distances are alike, i.e. no separation.