Skip to content

nervPass

function nervPass(
hdIn,
ldIn,
opts?): Nerv;

Defined in: passes/nerv.ts:280

NeRV in one call, single-threaded. See nerv for the metric itself.

ParameterType
hdInPointsInput
ldInPointsInput
optsNervOptions

Nerv

import { nervPass, nerv } from "@saehrimnir/sickle";
// Fits a per-point sigma in the data by bisection, then reuses it for the
// projection. Defaults: lambda 0.5, perplexity 30.
const p = nervPass(data, projection, { lambda: 0.5, perplexity: 30 });
nerv(p).value; // 0.4611
p.recall; // 77.6049 — a scalar, as is p.precision
p.local[0]; // per-point contributions, localKind "mean"
p.sigma[0]; // the bandwidth fitted for point 0