Repolode
lmcinnes

lmcinnes/umap

Python library for UMAP, a non-linear dimension reduction method used for visualization and as a preprocessing step for machine learning.

Stars
8,288
Forks
880
Open issues
539
Last commit
yesterday

What is it?

UMAP (Uniform Manifold Approximation and Projection) is a dimension reduction technique that projects high-dimensional data into a low-dimensional space, most often 2D or 3D for plotting. It can be used in a similar role to t-SNE, and also as a general-purpose reduction step before clustering or other machine learning tasks.

The package follows the scikit-learn API, so it can be called with fit_transform and used inside sklearn pipelines. Key parameters include n_neighbors, which balances local and global structure, min_dist, which controls how tightly points are packed, and metric, which accepts a range of distance functions including cosine and correlation. It also supports sparse matrix input and adding new points to an existing embedding through transform.

Beyond the core algorithm, the library includes a umap.plot subpackage for plotting embeddings, a Parametric UMAP variant that trains a neural network (requires TensorFlow), and densMAP, which additionally preserves local density information. Installation is available via pip or conda-forge.

Key features

  • 01Drop-in scikit-learn style API with fit and transform methods
  • 02Supports many distance metrics, including non-metric ones like cosine and correlation
  • 03Accepts sparse matrix input
  • 04Supports supervised and semi-supervised dimension reduction via the y parameter
  • 05Includes umap.plot for plotting embeddings and densMAP for density preservation

Use cases

  • Visualizing high-dimensional datasets such as embeddings or single-cell data in 2D
  • Reducing dimensionality before running clustering algorithms like HDBSCAN
  • Adding UMAP as a preprocessing step in a scikit-learn pipeline

Quick start

  1. 1

    Install via pip

    pip install umap-learn
  2. 2

    Install via conda (conda-forge)

    conda install -c conda-forge umap-learn
  3. 3

    Fit and transform data in Python: import umap, then call umap.UMAP().fit_transform(data)

Things to know

  • Parametric UMAP needs TensorFlow, which is an extra install.

In collections

Topics

#dimensionality-reduction#machine-learning#visualization#manifold-learning#clustering#python#topological-data-analysis#umap

FAQ

What is umap?
Python library for UMAP, a non-linear dimension reduction method used for visualization and as a preprocessing step for machine learning. UMAP (Uniform Manifold Approximation and Projection) is a dimension reduction technique that projects high-dimensional data into a low-dimensional space, most often 2D or 3D for plotting. It can be used in a similar role to t-SNE, and also as a general-purpose reduction step before clustering or other machine learning tasks.
Is umap free to use? What license does it have?
umap is open source under the BSD-3-Clause license. Check the license terms before using it in commercial products.
Is umap still maintained?
Actively maintained. The last commit to umap was on Nov 6, 2026.
What can I use umap for?
Visualizing high-dimensional datasets such as embeddings or single-cell data in 2D Reducing dimensionality before running clustering algorithms like HDBSCAN Adding UMAP as a preprocessing step in a scikit-learn pipeline
How do I install umap?
Install via pip: pip install umap-learn Install via conda (conda-forge): conda install -c conda-forge umap-learn Fit and transform data in Python: import umap, then call umap.UMAP().fit_transform(data)
Where can I get umap?
The source code and installation instructions are on GitHub: https://github.com/lmcinnes/umap

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects