Skip to content

localTrustworthiness

function localTrustworthiness(cr, k): Float64Array;

Defined in: metrics/neighborhood.ts:449

Per-point trustworthiness — which points the projection misplaces.

Averages to trustworthiness, so it is directly comparable with it, and suitable for colouring a scatterplot.

Requires k to have been listed in the pass’s localK.

ParameterType
crCoRanking
knumber

Float64Array

import { analyze, trustworthiness, localTrustworthiness } from "@saehrimnir/sickle";
// The pass must be told which k you want per-point values for.
const a = analyze(data, projection, { localK: [20] });
const local = localTrustworthiness(a.coRanking, 20);
local.length; // 200 — a bare Float64Array, one per point
local[0]; // 0.9528
// These average to the scalar:
trustworthiness(a.coRanking, 20); // 0.9659