UMAP, which stands for Uniform Manifold Approximation and Projection, is a dimensionality reduction technique widely used in machine learning to take high-dimensional data and represent it in a lower-dimensional space, typically two or three dimensions, for visualization or downstream analysis. It belongs to the family of nonlinear manifold learning methods, which assume that complex data, despite being represented in many dimensions, actually lies on or near a lower-dimensional surface embedded within that ambient space.
By approximating the structure of this surface, UMAP can produce compact representations that preserve much of the meaningful geometry of the original data. It has become a default tool for exploring embeddings produced by neural networks, clustering structures in large datasets, and understanding the shape of complex feature spaces.
The mathematical foundation
At its core, UMAP draws on ideas from topology and Riemannian geometry, treating the data as samples drawn from a manifold equipped with a locally varying metric. The algorithm constructs a weighted graph that captures the local neighborhood relationships among data points, where edge weights reflect the likelihood that two points are connected on the underlying manifold. This graph is built by considering each point's nearest neighbors and assigning fuzzy membership strengths based on distances normalized by local density. The result is a topological representation that captures both fine local structure and the coarser shape of the data.
Once this high-dimensional graph is built, UMAP searches for a low-dimensional layout whose own fuzzy neighborhood graph most closely matches the original. This match is quantified through a cross-entropy objective between the two fuzzy simplicial sets, and the layout is optimized using stochastic gradient descent. Attractive forces pull together points that are neighbors in the source graph, while repulsive forces push apart points that are not, producing the characteristic clustered visualizations that UMAP is known for.
How UMAP compares with related techniques
UMAP is often discussed alongside t-SNE, another popular nonlinear embedding method, and the two share a similar visual character in many applications. However, UMAP tends to preserve more of the global structure of the data, meaning that the relative positions of clusters in the embedding often carry interpretable meaning, not just the cluster contents themselves. It is also generally faster, scales better to large datasets, and supports embedding new points into an existing projection without retraining from scratch. Compared with linear methods such as PCA, UMAP captures curved and nonlinear relationships that linear projections cannot represent.
Hyperparameters and their effects
The behavior of UMAP is shaped by a small number of influential hyperparameters. The number of neighbors controls the balance between local and global structure: small values emphasize fine-grained local patterns, while larger values produce embeddings that reflect broader relationships across the dataset. The minimum distance parameter governs how tightly points may be packed together in the low-dimensional space, affecting whether clusters appear as dense pinpoints or as more diffuse regions. The choice of distance metric, whether Euclidean, cosine, Manhattan, or something domain-specific, determines how similarity is measured in the original space and can substantially change the resulting embedding.
Tuning these parameters is part of the practical art of using UMAP, since no single setting works for every dataset. Practitioners often run the algorithm several times with different configurations to understand which structures are stable and which depend on the choice of hyperparameters. Random initialization and the stochastic optimization process also mean that repeated runs produce embeddings that are similar in structure but not pixel-identical, which is worth keeping in mind when interpreting results.
Typical applications
UMAP appears across an enormous range of fields wherever high-dimensional data needs to be visualized or compressed. In single-cell biology, it is used to display gene expression profiles so that cell types form visible clusters. In natural language processing, it projects word, sentence, or document embeddings to reveal semantic groupings. In computer vision, it visualizes the internal representations of convolutional or transformer-based models, helping researchers understand what features a network has learned and how it organizes its perceptual space.
Beyond visualization, UMAP serves as a preprocessing step for clustering algorithms, since reducing dimensionality before applying methods like HDBSCAN or k-means can improve both speed and clustering quality. It is also used for anomaly detection, where points that fail to embed near any cluster may indicate outliers, and for feature engineering, where the reduced coordinates can become inputs to downstream predictive models. In retrieval and recommendation systems, UMAP can give intuitive overviews of large embedding spaces that would otherwise be impossible to inspect directly.
Strengths and limitations
The main strengths of UMAP include its computational efficiency, its ability to handle very large datasets, and its tendency to produce visually clean embeddings that highlight clusters and overall structure. It supports custom distance metrics, which makes it adaptable to domains where Euclidean distance is inappropriate, such as categorical data or specialized similarity measures. Its support for transforming new points into an existing embedding allows it to be incorporated into pipelines where new data arrives over time.
There are, however, important caveats. The distances between clusters in a UMAP plot should not be interpreted too literally; while UMAP preserves more global structure than t-SNE, the precise spacing between groups still reflects optimization dynamics as much as true geometry. Cluster sizes and densities in the embedding may not match those in the original space, and small isolated clusters can sometimes appear that are artifacts of parameter choices rather than meaningful structure. Because of this, UMAP visualizations should be treated as exploratory tools rather than definitive depictions of data geometry.
Stability, reproducibility, and interpretation
Reproducibility is a recurring concern with UMAP, since the algorithm relies on randomized initialization and stochastic optimization. Setting a random seed makes individual runs reproducible, but conclusions drawn from the embedding should ideally be validated across multiple seeds and parameter settings. Researchers commonly look for features that persist across runs, such as the existence of certain clusters or the relative positions of major groups, rather than relying on a single layout.
Interpreting a UMAP embedding requires care, especially when communicating results to non-specialists. Visual proximity does signal similarity under the model, but the absence of a connection or the placement of a gap need not imply a strict boundary in the data. Combining UMAP with quantitative measures such as silhouette scores, neighborhood preservation metrics, or downstream task performance helps ground intuitive visual impressions in measurable evidence.
Integration into machine learning workflows
In practical machine learning workflows, UMAP often sits between raw or learned feature representations and analytical tools that benefit from lower dimensionality. It is common to feed embeddings from a pretrained encoder into UMAP to obtain a two-dimensional view for dashboards or interactive exploration. Some teams use UMAP coordinates directly as compact features for classifiers, although this is a stronger commitment and depends on how stable the embedding is for the task at hand.
UMAP can also be combined with supervised information by providing labels during training, which biases the embedding to separate classes more cleanly while still respecting underlying geometry. Semi-supervised variants can leverage partial labels, and parametric versions implemented with neural networks allow the mapping itself to be learned as a differentiable function, useful when integrating dimensionality reduction into end-to-end systems. Through these capabilities, UMAP has established itself as a flexible and well-understood tool for navigating the high-dimensional spaces that modern machine learning produces.
