Skip to content
AI360Xpert
Core ML
Visual explainer

t-SNE & UMAP

How t-SNE and UMAP squash high-dimensional data into a 2D map by preserving local neighbourhoods instead of global geometry.

High-dimensional data cannot be plotted. We need a 2D view.
High-dimensional data cannot be plotted. We need a 2D view.

We can only see in three dimensions. If your data has 784 columns (like pixels in an image), plotting it natively is impossible. We need an algorithm to squash it onto a flat screen while keeping the natural groupings intact.

The Local Priority

t-SNE preserves local neighbourhoods: close points stay close, distant points are ignored.
t-SNE preserves local neighbourhoods: close points stay close, distant points are ignored.

t-SNE ignores the grand geometry of the dataset and focuses entirely on the local neighbourhood. If two points are very close in 784D space, t-SNE guarantees they stay close in 2D space. If they are far apart, it simply repels them away without caring exactly how far.

UMAP is Faster and Broader

UMAP is faster and preserves more global structure than t-SNE.
UMAP is faster and preserves more global structure than t-SNE.

UMAP approaches the problem using topological graphs. It is mathematically different but practically similar to t-SNE. It runs much faster and does a slightly better job of keeping global distances meaningful, meaning clusters that are somewhat related might stay nearer each other on the plot.

The Distance Illusion

Both create distinct clusters, but the distance between clusters is meaningless.
Both create distinct clusters, but the distance between clusters is meaningless.

Because both algorithms prioritise local neighbours and use repulsion to separate clusters, the empty white space on the plot is a lie. If Cluster A is drawn twice as far from Cluster B as it is from Cluster C, it does not mean A is truly twice as different from B. The gap is arbitrary.

Where It Breaks

The failure: sensitivity to random seeds and hyperparameters, no inverse transform.
The failure: sensitivity to random seeds and hyperparameters, no inverse transform.

These manifolds are highly unstable. Change the random seed or tweak the hyperparameter (perplexity in t-SNE, neighbours in UMAP) and the visual map changes completely. They are incredible for exploring data, but useless for predicting on new data because neither provides a stable inverse mapping.

The Quick Version

  • The goal: Squash hundreds of dimensions down to 2 or 3 for human plotting.
  • t-SNE: Focuses strictly on keeping immediate neighbours close.
  • UMAP: Faster alternative that keeps slightly more global context intact.
  • The illusion: Cluster separation distance on the screen is functionally meaningless.
  • Failure: Highly sensitive to seeds; cannot map new unseen points reliably.

What to Read Next