What is dimensionality reduction?
Dimensionality reduction is the process of representing data that has many features with far fewer, while keeping as much of its structure as possible. Linear methods such as principal component analysis (PCA) project the data onto a few new axes. Non-linear methods such as t-SNE and UMAP place points in two or three dimensions so that neighbors stay neighbors.
It is used to speed up and regularize models, to compress data, to remove noise, and above all to visualize high-dimensional data. Biologists plot single-cell gene expression with t-SNE or UMAP, ML engineers inspect word and image embeddings the same way, and PCA is a standard preprocessing step before clustering or regression on wide tables. Reducing dimensions also eases the curse of dimensionality, where distances and density estimates break down as features are added.
Key ideas
- Dimensionality reduction maps data with many features to fewer while keeping as much structure as possible.
- In high dimensions data becomes sparse and distances lose contrast, which hurts many models.
- PCA projects onto perpendicular directions of maximum variance, the eigenvectors of the covariance matrix.
- The number of components can be chosen from the scree plot, a variance target, or cross-validation.
- t-SNE keeps local neighborhoods for 2D visualization but distorts global distances.
- PCA is linear, fast, and reusable on new data, while t-SNE is mainly a visualization tool.
Common questions
What is the difference between dimensionality reduction and feature selection?
Feature selection keeps a subset of the original columns unchanged. Dimensionality reduction methods such as PCA build new features that mix all the original ones. Selection keeps features interpretable, while reduction can pack more of the information into fewer numbers.
Is PCA supervised or unsupervised?
PCA is unsupervised: it ignores labels and only looks at the spread of the inputs. The direction with the most variance is not always the one that separates classes. Linear discriminant analysis (LDA) is the supervised counterpart, choosing directions that best separate known classes.
When does PCA fail?
PCA can only find flat subspaces, so it struggles when data lies on a curved surface, such as the classic swiss roll. It can also discard a low-variance direction that happens to predict the target. Kernel PCA, autoencoders, and manifold methods such as UMAP handle curved structure better.
Can t-SNE or UMAP be used as model input features?
UMAP can transform new points and is sometimes used that way, though results vary between runs. Standard t-SNE has no way to embed new points without rerunning on the whole dataset, so it is used almost only for visualization. For model inputs, PCA or a learned embedding is the safer choice.
Related explainers
- Curse of Dimensionality — Why high-dimensional spaces break intuition and algorithms
- Singular Value Decomposition — Factor any matrix into rotation, scaling, and rotation — the Swiss army knife of linear algebra
- Eigenvalues & Eigenvectors — How matrices transform space — eigenvectors, eigenvalues, and decomposition
- Feature Extraction — How networks find patterns in raw data
- Autoencoders & VAEs — From compression to generation — standard and variational autoencoders
- K-Means Clustering — Unsupervised grouping by centroid distance
References
- van der Maaten & Hinton (2008), "Visualizing Data using t-SNE", JMLR
- McInnes, Healy & Melville (2018), "UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction"
- James, Witten, Hastie & Tibshirani, "An Introduction to Statistical Learning" (ISLR), chapter 12
Last updated