Skip to content

analyzeAsync

function analyzeAsync(
hdIn,
ldIn,
opts?): Promise<Analysis>;

Defined in: passes/parallel.ts:128

Rank and distance accumulators together, across workers.

ParameterType
hdInPointsInput
ldInPointsInput
optsAnalyzeAsyncOptions

Promise<Analysis>

import { analyzeAsync, trustworthiness } from "@saehrimnir/sickle";
// Same result as `analyze`, bit for bit, on however many workers. The worker
// is inlined into the published bundle, so this needs no bundler config.
const a = await analyzeAsync(data, projection, {
localK: [20],
workers: 4, // defaults to the hardware concurrency
onProgress: (done, total) => console.log(`${done}/${total}`),
signal: AbortSignal.timeout(30_000),
});
trustworthiness(a.coRanking, 20); // 0.9659

Below parallelThreshold points, or where workers are unavailable, it runs the synchronous kernel instead.