PCA vs t-SNE vs UMAP
PCA is a linear projection that preserves global variance, while t-SNE and UMAP are nonlinear neighbor embeddings that preserve local structure. That means PCA keeps large-scale geometry honest, distances and directions retain meaning, but it can miss curved structure, while t-SNE and UMAP reveal clusters vividly but distort distances between them. PCA is also the only one of the three that gives you an explicit, reusable transformation: you get axes you can project new data onto, invert, and interpret through feature loadings.
t-SNE and UMAP solve a similar problem, keep nearby points nearby in 2D, but with different machinery. t-SNE matches neighbor probabilities between the high-dimensional and low-dimensional spaces, and its perplexity knob sets the neighborhood size. UMAP builds a weighted nearest-neighbor graph and optimizes a low-dimensional layout of that graph. In practice UMAP runs faster, scales to larger datasets, preserves somewhat more global arrangement, and unlike classic t-SNE can transform new points after fitting.
The three are complements, not rivals. A standard workflow uses PCA first to denoise and compress, say to 30 or 50 dimensions, then runs t-SNE or UMAP on the reduced data for a 2D picture. Whatever you choose, read neighbor embeddings with care: cluster sizes, inter-cluster distances, and apparent density in a t-SNE or UMAP plot are artifacts of the optimization, not facts about your data.
Side by side
Core idea
Rotate the data to the orthogonal directions of greatest variance and keep the top few as new axes.
Convert pairwise similarities into neighbor probabilities and find a 2D layout that matches them, keeping close points close.
Build a weighted k-nearest-neighbor graph of the data and optimize a low-dimensional layout that preserves that graph's structure.
Linear or nonlinear
Linear; the embedding is a rotation and projection, so straight-line structure and directions survive.
Nonlinear; it can unfold curved manifolds and separate clusters no linear projection could split.
Nonlinear; like t-SNE it captures curved structure, with a graph-based objective instead of probability matching.
What it preserves
Global variance and relative distances along the retained components; large-scale geometry stays meaningful.
Local neighborhoods; which points are near each other is faithful, while global arrangement is largely arbitrary.
Local neighborhoods plus some global arrangement; relative cluster positions tend to be more trustworthy than in t-SNE.
What it distorts
Nonlinear structure; a curved manifold can collapse onto itself, and small-variance but informative directions get discarded.
Inter-cluster distances and cluster sizes; gaps and blob areas in the plot do not measure real separation or spread.
Distances and densities are still distorted, and it can fragment continuous structure into false-looking clusters.
Key hyperparameters
Number of components, chosen by explained-variance ratio; feature scaling beforehand matters more than any knob.
Perplexity, roughly the effective neighborhood size, typically 5 to 50, plus learning rate and iteration count.
n_neighbors trades local versus global emphasis, and min_dist controls how tightly points pack in the layout.
Speed and scalability
Very fast; essentially an eigendecomposition or truncated SVD, routine on millions of rows.
Slowest of the three; Barnes-Hut and interpolation variants help, but large datasets remain painful.
Much faster than t-SNE and comfortable at hundreds of thousands of points.
Transforming new data
Trivial; PCA is an explicit linear map, so you project new points with a matrix multiply and can invert it.
Not supported in the classic algorithm; you must re-run the embedding, and parametric variants are a separate tool.
Supported; a fitted UMAP model can embed new points, though the transform is approximate.
Determinism
Deterministic up to sign flips of the components; the same data gives the same answer.
Stochastic; different seeds give visibly different layouts, so conclusions should survive multiple runs.
Stochastic; more stable than t-SNE run-to-run, but the layout still varies with the seed.
Interpretability of axes
Components have loadings, so you can read which original features drive each axis.
Axes are meaningless; only neighborhood relationships in the plot carry information.
Axes are meaningless here too; read cluster membership and neighbors, never coordinates.
Typical use cases
Preprocessing and compression before other models, decorrelating features, denoising, and quick first-look plots.
Publication-quality 2D visualizations of clusters in embeddings, single-cell data, and other high-dimensional point clouds.
Exploratory visualization at scale, general nonlinear reduction, and pipelines that must embed new data after fitting.
| Dimension | Principal Component Analysis | t-SNE | UMAP |
|---|---|---|---|
| Core idea | Rotate the data to the orthogonal directions of greatest variance and keep the top few as new axes. | Convert pairwise similarities into neighbor probabilities and find a 2D layout that matches them, keeping close points close. | Build a weighted k-nearest-neighbor graph of the data and optimize a low-dimensional layout that preserves that graph's structure. |
| Linear or nonlinear | Linear; the embedding is a rotation and projection, so straight-line structure and directions survive. | Nonlinear; it can unfold curved manifolds and separate clusters no linear projection could split. | Nonlinear; like t-SNE it captures curved structure, with a graph-based objective instead of probability matching. |
| What it preserves | Global variance and relative distances along the retained components; large-scale geometry stays meaningful. | Local neighborhoods; which points are near each other is faithful, while global arrangement is largely arbitrary. | Local neighborhoods plus some global arrangement; relative cluster positions tend to be more trustworthy than in t-SNE. |
| What it distorts | Nonlinear structure; a curved manifold can collapse onto itself, and small-variance but informative directions get discarded. | Inter-cluster distances and cluster sizes; gaps and blob areas in the plot do not measure real separation or spread. | Distances and densities are still distorted, and it can fragment continuous structure into false-looking clusters. |
| Key hyperparameters | Number of components, chosen by explained-variance ratio; feature scaling beforehand matters more than any knob. | Perplexity, roughly the effective neighborhood size, typically 5 to 50, plus learning rate and iteration count. | n_neighbors trades local versus global emphasis, and min_dist controls how tightly points pack in the layout. |
| Speed and scalability | Very fast; essentially an eigendecomposition or truncated SVD, routine on millions of rows. | Slowest of the three; Barnes-Hut and interpolation variants help, but large datasets remain painful. | Much faster than t-SNE and comfortable at hundreds of thousands of points. |
| Transforming new data | Trivial; PCA is an explicit linear map, so you project new points with a matrix multiply and can invert it. | Not supported in the classic algorithm; you must re-run the embedding, and parametric variants are a separate tool. | Supported; a fitted UMAP model can embed new points, though the transform is approximate. |
| Determinism | Deterministic up to sign flips of the components; the same data gives the same answer. | Stochastic; different seeds give visibly different layouts, so conclusions should survive multiple runs. | Stochastic; more stable than t-SNE run-to-run, but the layout still varies with the seed. |
| Interpretability of axes | Components have loadings, so you can read which original features drive each axis. | Axes are meaningless; only neighborhood relationships in the plot carry information. | Axes are meaningless here too; read cluster membership and neighbors, never coordinates. |
| Typical use cases | Preprocessing and compression before other models, decorrelating features, denoising, and quick first-look plots. | Publication-quality 2D visualizations of clusters in embeddings, single-cell data, and other high-dimensional point clouds. | Exploratory visualization at scale, general nonlinear reduction, and pipelines that must embed new data after fitting. |
When to use Principal Component Analysis
- You need dimensionality reduction as input to another model, not just a picture, and want a fast, deterministic, invertible transform.
- You want to know which original features drive the variation, via component loadings and explained-variance ratios.
- You must embed new data cheaply in production with a single matrix multiply.
- You are preprocessing before t-SNE or UMAP to reduce noise and computation, a standard first step.
- Your data's structure is roughly linear, or you only need to remove correlation rather than uncover manifolds.
When to use t-SNE
- You want the sharpest possible visual separation of clusters in a 2D figure and the dataset is modest, up to tens of thousands of points.
- Local neighborhood fidelity matters more than global layout, for example checking whether known classes form coherent groups.
- You can afford to run it several times at different perplexities to confirm the structure is real.
- You are producing a one-off exploratory or publication figure rather than a reusable transformation.
When to use UMAP
- You need t-SNE-style cluster visualization but the dataset is large and t-SNE is too slow.
- You care about the relative arrangement of clusters, not just their existence, and want more global structure preserved.
- You need to embed new points after fitting, which classic t-SNE cannot do.
- You want a nonlinear reduction to more than two dimensions as features for a downstream model, used with appropriate caution.
The bottom line
Use PCA whenever the output feeds another computation: it is fast, deterministic, interpretable, and reversible, and it should almost always run first as a denoising step anyway. For visualization, default to UMAP: it is faster than t-SNE, handles large datasets, keeps more global arrangement, and can embed new points. Reach for t-SNE when you want the most locally faithful picture of a modest dataset and are willing to tune perplexity and rerun with different seeds. And regardless of which embedding you plot, never quote distances, cluster sizes, or densities from a t-SNE or UMAP figure as evidence; verify any structure you see with numbers computed in the original space.