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.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
cr | CoRanking |
k | number |
Returns
Section titled “Returns”Float64Array
Example
Section titled “Example”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 pointlocal[0]; // 0.9528// These average to the scalar:trustworthiness(a.coRanking, 20); // 0.9659