npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@saehrimnir/sickle

v0.2.0

Published

Quality metrics for dimensionality reduction projections.

Readme

sickle — Quality Metrics for Dimensionality-Reduction Projections.

Every projection distorts. The question is not whether, but how much and in which way — and no single number answers it. sickle gives you 33 measures across eight families behind one API, each declaring what it needs, what it ranges over, and what it was verified against.

CI NPM Downloads License

Installation

If you use npm, install with npm install @saehrimnir/sickle, and use it with

import * as sickle from "@saehrimnir/sickle";

Otherwise download the files here, or use for instance unpkg this way:

<script src="https://unpkg.com/@saehrimnir/sickle/dist/sickle.umd.js"></script>

Quick start

import * as sickle from "@saehrimnir/sickle";

const a = sickle.analyze(data, projection); // one O(N²·D) sweep

sickle.trustworthiness(a.coRanking, 20); // 0.9659 — are the drawn neighbours real?
sickle.continuity(a.coRanking, 20);      // 0.9709 — are the real ones still drawn together?
sickle.stress(a.moments).value;          // 0.0807 — did the distances survive?

Almost every measure is a cheap read-out of a shared pass, so computing eight costs what computing one costs. Inputs are number[][], a DruidJS Matrix (zero-copy), or an already-converted Vectors.

A few accumulators are off by default because they are not free. Ask for them when you set the pass up, not when you read the measure:

const a = sickle.analyze(data, projection, {
    localK: [20],   // per-point values, at these k
    densityK: 20,   // for densityPreservation
    triplets: true, // for tripletAccuracy
    ccaLambda: 1,   // for curvilinearStress
});

Past roughly 5 000 points, move the sweep to workers. The result is bit-identical, and the worker is inlined into the published bundle, so it needs no bundler configuration:

const a = await sickle.analyzeAsync(data, projection, { localK: [20] });

Measures

Neighbourhoodtrustworthiness · continuity · qnx · rnx · lcmc · aucLogRnx · mrreFalse · mrreMissing

Distancestress · scaleNormalizedStress · nonMetricStress · pearsonR · spearmanRho · residualVariance

Embedding costsammonStress · curvilinearStress · nerv

Class separabilitysilhouette · calinskiHarabasz · daviesBouldin · dunnIndex · distanceConsistency · averageBetweenWithin · hypothesisMargin · neighborhoodHit · classificationError · gabrielClassificationError

StructuredensityPreservation · tripletAccuracy

TopologytopologicalH0 · topologicalH1

Cluster reliabilitysnc (steadiness & cohesiveness)

Scagnosticsnine shape measures of the projection alone: outlying, skewed, clumpy, sparse, striated, convex, skinny, stringy, monotonic

const cl = sickle.clusters(projection, labels); // built once, shared by ten measures
sickle.silhouette(projection, cl).value;
sickle.scagnostics(projection); // { outlying, skewed, clumpy, ... }

Per-point values have a contract

Where a measure decomposes, the local array comes with a localKind saying how it relates to the total — mean, share, sum, partial-mean or none. They are not interchangeable: averaging a share does not give the total, and colouring one on a "0 = good" scale claims every point is nearly perfect.

checkContract() asserts the declared relationship, and the test suite applies it to every registered measure. See Reading a score.

Verification

Every measure says what it was checked against, in three tiers: a published reference implementation (zadu, scikit-learn, scipy, gudhi, ripser, DRquality, Scagnostics2018), a naive transcription of the definition, or behaviour only. The verification page gives the tolerance for each, and documents the places where sickle deliberately does not match its reference — including a scipy MST that drops zero-weight edges and a DRquality division that silently discards Gabriel leaves.

pnpm fixtures   # regenerate the CSVs (deterministic)
pnpm reference  # regenerate reference.json  — needs: pip install zadu
pnpm test

Performance

One pass, every measure, every k. The co-ranking matrix is (N-1)² — 400 MB at N = 10 000 — so it is never materialised; every quantity is a range update over k, folded into difference arrays and resolved by one prefix sum. That gives the complete curve in O(N² log N) time and O(N) memory.

Partial passes are a monoid, so analyzeAsync splits rows across workers and recombines in a fixed order — bit-identical to the single-threaded run, asserted with deepEqual rather than a tolerance. No SharedArrayBuffer, so no cross-origin-isolation requirement.

Numbers, complexity per measure and the ceilings that make a measure refuse rather than exhaust memory: Performance.

Resources

Built to interoperate with DruidJS, which produces the projections it scores.

Status: neighbourhood, distance, embedding-cost, separability, structure, topology, cluster-reliability and scagnostics families are implemented and verified. Still missing: Procrustes and the topographic product. Persistent homology covers H0 and H1; H1 is capped at ~200 points, see src/metrics/NOTES-topology.md. SepMe lives in its own project (SepMeJS) — a framework of 2002 measures with a different contract, not a metric.