UMAP-JS is a JavaScript implementation of the Uniform Manifold Approximation and Projection (UMAP) algorithm, a popular dimension reduction technique for both visualization and general non-linear dimension reduction. Currently stable at version 1.4.0, the library offers synchronous, asynchronous, and step-by-step fitting methods, allowing for flexible integration into various application contexts. Key differentiators from the original Python implementation include the use of a random embedding to seed the optimization step, rather than a spectral embedding, which yields comparable results for smaller datasets but avoids complex eigenvalue/eigenvector computations in JavaScript. The library also lacks specialized functionality for angular distances or sparse data representations. Releases appear to follow an irregular schedule, with the last publish about two years ago, but the project is maintained by PAIR-code, indicating ongoing support.
npm install umap-jsVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing UMAP, generating sample data, performing synchronous dimension reduction, and transforming new data points.
Be aware of these architectural differences when porting Python UMAP workflows or expecting identical behavior. Evaluate performance on your specific datasets.
Preprocess sparse data into dense representations or calculate custom distance metrics if angular distances are critical for your application.
Always use the officially documented named imports, primarily `UMAP`. Avoid importing internal symbols which are subject to change without major version bumps.
Ensure you are using named imports with ESM: `import { UMAP } from 'umap-js';` or proper destructuring for CJS: `const { UMAP } = require('umap-js');`.Install the package using your package manager: `npm install umap-js` or `yarn add umap-js`.
No dependency data recorded yet.