Skip to content

rnx

function rnx(cr, k): number;

Defined in: metrics/neighborhood.ts:241

Neighbourhood preservation rescaled so chance is 0 and perfect is 1.

Preferred over qnx when comparing across different k or dataset sizes, since those cancel out.

  • Needs: high-dimensional data and projection. No labels.
  • Range: [0, 1] in practice, higher is better; 0 is a random projection.
  • Cost: O(1), from an O(N² log N) pass.
ParameterType
crCoRanking
knumber

number

Lee & Verleysen, Neurocomputing 72 (2009) https://doi.org/10.1016/j.neucom.2008.12.017

import { analyze, rnx } from "@saehrimnir/sickle";
const a = analyze(data, projection); // number[][] straight in
rnx(a.coRanking, 20); // 0.5172 on a PCA projection
// the same call on a random projection of the same points: 0.0042