Manifold learning

Also known as: nonlinear dimensionality reduction

On this page 7

Manifold learning is a family of nonlinear dimensionality reduction methods that assume high-dimensional data lie on or near a low-dimensional curved surface, a manifold, and that try to recover coordinates on that surface. In machine learning, a core discipline of artificial intelligence, it is used to visualize, compress and explore data whose structure linear methods such as principal component analysis cannot capture.

The central premise is the manifold hypothesis: images, sounds, gene expression profiles and many other datasets occupy only a tiny, smoothly connected part of their ambient space. A set of face photographs with thousands of pixels may vary mainly along a handful of factors, such as pose and lighting, and manifold learning aims to expose exactly those factors.

How manifold learning recovers hidden structure

Manifold learning works by preserving local geometry rather than global straight-line distances. Most methods follow the same three steps: build a neighborhood graph that connects each point to nearby points, summarize the geometry of that graph, and find a low-dimensional embedding that keeps the summary as intact as possible.

The key insight is that Euclidean distance is reliable only locally. Two points on opposite sides of a rolled sheet, the classic Swiss roll dataset, may be close in the ambient space but far apart along the surface. By chaining short, trustworthy neighbor distances, a method can approximate the intrinsic distance along the manifold and unroll the structure.

IngredientPurposeTypical setting
Neighborhood graphCaptures local structurek-nearest neighbors, k from 5 to 50
Local geometry modelDescribes how neighbors relateDistances, weights or affinities
Embedding objectiveDefines what must be preservedDistances, reconstructions or probabilities
Target dimensionSets output coordinates2 or 3 for plots, higher for features
SolverComputes the embeddingEigendecomposition or gradient descent
Core ingredients of a manifold learning pipeline

Main manifold learning algorithms

The algorithms differ in which geometric property they preserve. Spectral methods solve an eigenvalue problem and give a deterministic result, while probabilistic methods optimize a non-convex objective and are mainly used for visualization.

AlgorithmWhat it preservesTypical use
IsomapGeodesic distances along the graphUnrolling smooth, convex manifolds
Locally linear embeddingLinear reconstruction weights of neighborsSmooth manifolds with uniform sampling
Laplacian eigenmapsCloseness of graph neighborsSpectral features and clustering
Diffusion mapsRandom-walk connectivity at a time scaleNoisy data and dynamical systems
t-SNENeighbor probabilities, mainly localTwo-dimensional cluster visualization
UMAPFuzzy topological neighborhood structureFast visualization and general embeddings
Well-known algorithms and what they preserve

Kernel PCA is closely related: with suitable kernels, several spectral methods can be written as kernel PCA on a data-dependent kernel. Autoencoders offer a neural alternative that learns an explicit mapping, and they are often discussed alongside manifold learning even though they belong to deep learning.

Manifold learning compared with linear reduction

The essential difference from linear techniques is that manifold learning can follow curved structure, whereas principal component analysis and singular value decomposition project data onto a flat subspace. That flexibility has a price in stability, scalability and interpretability.

PropertyPrincipal component analysisManifold learning
Structure capturedGlobal linear varianceLocal nonlinear geometry
Mapping for new pointsExact projection matrixOften missing or approximate
Computational costLow, scales wellHigher, graph-dependent
DeterminismUnique solutionSpectral: yes; t-SNE and UMAP: seed-dependent
Interpretability of axesLoadings on original featuresAxes usually have no direct meaning
Linear and nonlinear dimensionality reduction compared

A sound practice is to start with principal component analysis. If the leading components explain most of the variance and the structure looks linear, a nonlinear method adds little. PCA is also commonly applied first to reduce noise and dimension to about 50, which speeds up and stabilizes t-SNE or UMAP.

Choosing and tuning a method

The right method depends on whether the goal is visualization, features or analysis. The neighborhood size is the most influential hyperparameter: too small fragments the manifold into disconnected pieces, too large creates short-circuit edges that cut across folds.

GoalRecommended methodReason
Visualize clusters in 2Dt-SNE or UMAPStrong local separation
Embed new points laterUMAP or parametric variantsProvides a transform for new data
Recover a smooth global layoutIsomap or diffusion mapsPreserves large-scale geometry
Large datasets of millions of pointsUMAP with approximate neighborsScales near-linearly
Mostly linear structurePrincipal component analysisSimpler and more stable
Decision guide for common goals
  • Scale features first, because distance-based graphs are dominated by large-valued features.
  • Try several neighborhood sizes and random seeds, and trust only patterns that persist.
  • Check graph connectivity; disconnected components produce meaningless relative positions.

Limitations and common misinterpretations

Manifold learning embeddings are easy to overinterpret. In t-SNE plots in particular, cluster sizes and the distances between clusters carry little reliable meaning, and apparent clusters can appear in pure noise when the perplexity is poorly chosen.

Methods also assume adequate and fairly uniform sampling of the manifold. Sparse regions, holes or noise in the data break the neighborhood graph, and the curse of dimensionality makes nearest neighbors less meaningful as dimension grows. For downstream prediction, embeddings should be validated against task performance, not judged by how attractive the plot looks.

The table below lists frequent misreadings of embeddings, the reason they mislead and the safer practice that experienced analysts follow.

MisreadingWhy it misleadsSafer practice
Large cluster means many pointst-SNE equalizes cluster densityCount points directly
Distant clusters are very differentGlobal distances are distortedCompare in the original space
Visible clusters prove real groupsNoise can form apparent clustersTest stability across seeds
One run is representativeNon-convex objectives vary by seedRepeat runs and compare
Axes have physical meaningEmbedding axes are arbitraryInterpret neighborhoods, not axes
Common misreadings and safer practices

Quantitative checks complement visual inspection. Trustworthiness and continuity scores measure how well local neighborhoods survive the embedding, and comparing results with a simple linear baseline shows whether the nonlinear method actually adds information.

Explained without jargon

Picture a long paper strip rolled up like a cinnamon roll. An ant walking on the paper only moves along the strip. Yet two spots on neighboring layers look close if you measure straight through the air.

Manifold learning tries to unroll the paper. It looks at which points are true neighbors on the surface. Then it lays the data flat while keeping those neighbors together.

Real data, such as photos, often works the same way. They look complex, but they change along a few hidden directions. Finding those directions makes the data easier to see and understand.

A typical use case

A research group studies single-cell gene expression from about 80,000 cells, each described by roughly 20,000 gene counts. The researchers need to see which cell types are present and how cells transition between states, which is impossible to read from the raw table.

After normalizing counts and selecting 2,000 variable genes, they apply principal component analysis to reduce the data to 50 components. They then build a 15-nearest-neighbor graph and compute a two-dimensional UMAP embedding, repeating the run with three random seeds to confirm stability.

The plot reveals distinct groups that match known immune cell types and a continuous trajectory of differentiating cells. The team treats the embedding as a map for exploration and confirms each finding with clustering on the neighbor graph and marker gene statistics, not with distances read off the plot.