UMAP builds a weighted neighbour graph with membership strengths , where is the distance from to its nearest neighbour. (a) For a point with neighbours at distances , and , find , solve for so the strengths sum to , and give the three strengths. (b) How are directed strengths combined into an undirected weight? (c) How do UMAP and t-SNE differ?
Unsupervised learning, t-SNE and UMAP
Level L4 Advanced. Length Long. Nature Th+Mat Both.
What's being asked
Whether you understand UMAP's graph construction, local connectivity and cross-entropy objective, and how they differ from t-SNE.
Key idea
UMAP turns each point's neighbourhood into a fuzzy set whose nearest neighbour has strength exactly (via ), symmetrises the graph with the probabilistic t-conorm , then lays it out in low dimensions by minimising the cross-entropy between the high- and low-dimensional edge weights.
Steps
- The nearest neighbour is at distance , so . Subtracting it makes the nearest neighbour's strength , which guarantees every point is connected to at least one neighbour (local connectivity).
- The shifted distances are , and . We need , i.e. . This has no closed form, so is found by binary search: .
- The strengths are , and . They sum to , as required. Here plays the role that perplexity plays in t-SNE.
- The directed weights and differ, because each point has its own and . Combine them as (the probability that at least one of two independent edges exists). For and , .
- In the embedding, edge weights are (with constants fitted from `min_dist`). UMAP minimises the cross-entropy using stochastic gradient descent, with negative sampling for the repulsive term.
- Differences from t-SNE: the second (repulsive) term pushes non-neighbours apart, so global structure is better kept; no normalisation over all pairs is needed, which makes it faster and lets it embed into more than 2 dimensions; and a non-random initialisation (spectral) gives more stable results. The `min_dist` parameter controls how tightly points are packed.
Common mistakes
- Interpreting distances between clusters or cluster sizes in a UMAP plot as quantitative. They remain only qualitative.
- Setting or ignoring it, which loses the guarantee that every point has a strong edge.
- Saying that UMAP has no hyperparameters. `n_neighbors` and `min_dist` change the picture a lot.
How long your answer should be
One page; 8 minutes.
Last checked on 4 December 2026.
Read this
Previous in Unsupervised learning: In locally linear embedding (LLE), the weights reconstruct a point from its neighbours by minimising subject to . (a) Derive the closed-form weights using the local Gram matrix. (b) For with neighbours and , compute the weights. (c) What is the second stage of LLE, and why is regularisation needed when ?
Next in Unsupervised learning: Why is the log-likelihood of a Gaussian mixture unbounded above when each component has its own covariance matrix? How do you show it in one dimension with , and how do EM implementations avoid the problem?