analyzeAsync
function analyzeAsync( hdIn, ldIn,opts?): Promise<Analysis>;Defined in: passes/parallel.ts:128
Rank and distance accumulators together, across workers.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
hdIn | PointsInput |
ldIn | PointsInput |
opts | AnalyzeAsyncOptions |
Returns
Section titled “Returns”Promise<Analysis>
Example
Section titled “Example”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.9659Below parallelThreshold points, or where workers are unavailable, it runs
the synchronous kernel instead.