Skip to content

maxKTrustworthiness

function maxKTrustworthiness(n): number;

Defined in: metrics/neighborhood.ts:47

Largest neighbourhood size trustworthiness and continuity are defined for.

floor(n / 2), and the bound is exact rather than cautious.

The Venna-Kaski normaliser is the reciprocal of the worst penalty a projection can incur, so that the worst case scores exactly 0. At k = n/2 a maximally wrong projection fills all k neighbour slots with points from the other half, and the two counts meet exactly. Past that there are only n - 1 - k points outside the neighbourhood — fewer than k — so the worst case is bounded by how many wrong points exist rather than by how many slots there are, and the constant no longer normalises it:

n · [ k(n − k) − k(k + 1)/2 ] k ≤ n/2, what the constant assumes
n · (n − 1 − k)(n − k)/2 above it, the real bound

The two agree at floor(n / 2) and diverge above it, so the score drifts below 0 — reaching -6.6 on a random projection at n = 200, k = 132.

An earlier version allowed floor((2n − 2)/3), which only keeps the denominator 2n − 3k − 1 positive. That is a weaker condition and it admits the whole degenerate range.

ParameterType
nnumber

number

import { maxKTrustworthiness, maxKQnx, maxKRnx } from "@saehrimnir/sickle";
// These take the point count, not a co-ranking matrix.
maxKTrustworthiness(200); // 100 — also the limit for `continuity`
maxKQnx(200); // 199 — also the limit for `lcmc`
maxKRnx(200); // 198