UMAPUniform Manifold Approximation and Projection
Imagine you are studying cancer cells — thousands of them — and each one is described by the activity levels of twenty thousand genes. Every cell is a point in a twenty thousand-dimensional space. You cannot visualize that.
You cannot intuit it. You cannot hand it to a colleague and say, look at this. What you need is a way to compress that information down to two or three dimensions while keeping the structure intact — the clusters, the gradients, the relationships that actually matter. That is the problem dimensionality reduction solves.
The dominant tool for this job, for many years, was t-SNE — t-distributed Stochastic Neighbor Embedding. It became the standard for visualizing high-dimensional data precisely because it is good at revealing local clusters. But t-SNE has real limitations.
It is slow, especially on large datasets. It struggles to preserve global structure — the relationships between clusters, not just within them. And it cannot take a new data point and place it into an existing embedding.
Every run is a fresh calculation from scratch. For many practical workflows, that is a serious problem.
In 2018, Leland McInnes, John Healy, Nathaniel Saul, and Lukas Großberger introduced Uniform Manifold Approximation and Projection — UMAP. The paper positions it directly alongside t-SNE as a visualization tool, but the ambitions are broader. UMAP is designed for general non-linear dimensionality reduction, not just two-dimensional plots.
It is significantly faster than most t-SNE implementations. And it comes with a scikit-learn compatible application programming interface, meaning it slots directly into existing Python machine learning pipelines without friction.
What makes UMAP distinctive, though, is not just the speed or the application programming interface. It is the mathematical foundation. McInnes and Healy ground UMAP in Riemannian geometry and algebraic topology — two areas of pure mathematics that are not typically associated with practical data science tools.
Understanding why they chose this foundation is key to understanding what UMAP actually does.
The core assumption UMAP makes is called the manifold hypothesis. The idea is that high-dimensional data — those twenty thousand gene expression values, for instance — does not actually spread out randomly through all twenty thousand dimensions. Instead, it lies on or near a much lower-dimensional curved surface, called a manifold, that is embedded within that high-dimensional space.
Think of it like a crumpled piece of paper inside a three-dimensional room. The paper is two-dimensional, but it exists in three dimensions. The goal of dimensionality reduction, under this assumption, is to unfold that paper — to find the intrinsic low-dimensional structure and lay it flat.
Riemannian geometry is the mathematics of curved spaces. In a curved space, distances are not uniform. The shortest path between two points curves along the surface rather than cutting straight through the ambient space.
UMAP uses this to think carefully about what distance means locally, near each data point. Rather than applying a single global metric, it estimates the local geometry of the manifold from the data itself.
The mathematical object UMAP uses to represent that geometry is called a fuzzy simplicial set. This is a topological construct — a way of encoding not just pairwise distances but the higher-order connectivity structure of the data. Think of it as a weighted graph where the edge weights encode how likely two points are to be genuinely close neighbors on the underlying manifold, as opposed to just happening to be near each other in the raw high-dimensional space.
UMAP builds this fuzzy topological representation from the data, then optimizes a second fuzzy simplicial set in low-dimensional space — two or three dimensions — to match it as closely as possible. The optimization minimizes the cross-entropy between the two representations, which is a standard information-theoretic measure of how different two probability distributions are.
The algorithm itself has two phases. In the first phase, UMAP constructs the high-dimensional graph using k-nearest neighbors — finding the k closest points to each data point — and then applies local normalization so that sparse and dense regions of the data are treated on comparable terms. A point in a crowded cluster and a point in a sparse outlying region get their neighborhoods scaled appropriately, rather than being measured against the same global ruler.
This local rescaling is part of what allows UMAP to preserve both local and global structure.
In the second phase, UMAP initializes a low-dimensional layout and then refines it using stochastic gradient descent with negative sampling. Negative sampling is a computational trick borrowed from natural language processing — instead of comparing every pair of points at every step, you sample a small number of pairs, which makes each iteration dramatically cheaper. This is a large part of why UMAP is fast.
The speed difference is real and practically significant. McInnes and Healy describe UMAP as among the fastest manifold learning implementations available, and significantly faster than most t-SNE implementations. For large datasets where t-SNE becomes prohibitively slow, UMAP offers a way to keep working.
But speed alone would not make UMAP compelling. The more important claim is about what the embedding preserves. Because UMAP is optimizing a representation of the global topological structure — the fuzzy simplicial set — rather than just local neighborhood relationships, it tends to maintain more of the global layout.
Clusters that are far apart in high-dimensional space stay far apart in the low-dimensional embedding. That is not always true with t-SNE, which is known to distort global distances in service of tightening local clusters.
The practical capabilities of UMAP extend well beyond single-use visualization. Three features in particular separate it from t-SNE as a general-purpose tool. First, UMAP supports supervised dimensionality reduction.
If you have label information — you know which cells are cancerous, which are healthy, which belong to which tissue type — you can provide those labels and UMAP will incorporate them into the embedding. The resulting layout is shaped not just by the raw structure of the data but by the class distinctions you care about. Second, UMAP handles semi-supervised scenarios, where only some points are labeled and the rest are unlabeled.
The algorithm can work with that mixed information, using the labeled points to guide the embedding of the unlabeled ones.
Third, and perhaps most useful for production machine learning workflows, UMAP can transform new, unseen data into a pretrained embedding space. You train the embedding on your existing dataset, and then when new data arrives, you project it into that same space without rerunning the full algorithm. T-SNE cannot do this natively.
Every new point requires a full recomputation. UMAP's ability to do out-of-sample transforms comes directly from its mathematical structure — because the embedding is defined by a learned mapping rather than a fixed set of coordinates, applying it to new inputs is a natural extension.
Taken together, these capabilities — supervised use of labels, semi-supervised use of partial labels, and out-of-sample transforms — are what allow UMAP to function as a preprocessing step inside a larger machine learning pipeline, not just a one-off visualization tool. You could reduce your training data to fifty dimensions with UMAP, train a classifier in that reduced space, and then project new test data into the same fifty-dimensional space before running inference. The embedding becomes a reusable component.
What McInnes, Healy, Saul, and Großberger have built is a tool that sits at an unusual intersection. The mathematics behind it — Riemannian geometry, algebraic topology, fuzzy set theory — is genuinely sophisticated. Most practitioners using scikit-learn do not need to engage with any of that.
They call fit and transform and get an embedding. But the rigor is what gives the tool its properties: the global structure preservation, the principled handling of local geometry, the flexibility to extend to supervised settings. The theory and the practice are not in tension here. The theory is why the practice works.
UMAP does not claim to answer every question about high-dimensional data. What it supplies is a fast, flexible, mathematically grounded platform for reducing and embedding that data — one that is ready to be integrated into real workflows and evaluated on real problems. For anyone working with complex, high-dimensional datasets, that combination is worth taking seriously.
This lecture was created by ennepō.
Go to https://ennepo.ai to Discover, Create and Follow the latest research in your field.
Read when you can. Listen when you want to.
Related lectures
- Developing a Sustainable Digital Transformation Roadmap for SMEs: Integrating Digital Maturity and Strategic Alignment
- One path to acoustic cloaking
- Unsupervised learning of digit recognition using spike-timing-dependent plasticity
- Improved charge extraction in inverted perovskite solar cells with dual-site-binding ligands
- The Digital Twin of the City of Zurich for Urban Planning
- A Multiagent Approach to Autonomous Intersection Management