Skip to content
AI.info

Unsupervised learning

Manifold Learning: MDS, Isomap, LLE, and Diffusion Maps

Compare classical manifold-learning families, understand the geometry each preserves, and diagnose when their assumptions fail.

By the end you can

Key idea

Two grids, 81 x 41 and 81 x 39, and only one of them survives the embedding

Two rectangular grids, differing in nothing but shape: 81 x 41, aspect ratio 1.98, and 81 x 39, aspect ratio 2.08. Goldberg and colleagues embedded both in 2008. With K = 8 neighbours, and with diffusion maps run at normalization constant alpha = 1 and kernel width sigma = 2, the first grid was recovered and the second collapsed into a nearly one-dimensional curve. The picture from the narrower grid is smooth. It is also a dimension short.

This is not a tuning accident. Their Theorem 4.1, stated for K = 4, 8 and 12 neighbours, says that Laplacian eigenmaps cannot recover a two-dimensional grid whose aspect ratio exceeds 2, and prefer the nearly one-dimensional curve instead. The same paper extends the argument to diffusion maps. On those two grids LLE and LTSA roughly recovered the shape at K = 4, 8, 16 and 64, while HLLE ran out of memory. The collapse of the whole normalized-output family — LLE, Laplacian eigenmaps, LTSA, Hessian eigenmaps and diffusion maps — was demonstrated separately, at larger aspect ratios: a swiss roll stretched by a factor of 3, and a “fishbowl” stretched by a factor of 4.

More data does not rescue it. Take a uniform sample from the strip [0,L] x [0,1] and let the sample grow: “Thus, if L > 4 we do not expect either LEM or DFM to recover the structure of the strip as the number of points in the sample tends to infinity.” The failure holds “regardless of the choice of parameters”.

Sixteen years later a survey by Meilă and Zhang reports the behaviour as routine rather than exotic: “such algorithms fail when the data manifold has a large aspect ratio (such as a long, thin strip, or a thin torus). This problem has been called the Repeated Eigendirection Problem (REP) and has been demonstrated for LLE, LE, LTSA, HE (Goldberg et al., 2008), and is pervasive in real data sets.”

So inspect graph connectivity, neighbour overlap, reconstruction error, component behaviour and stability under resampling before reading a coordinate as a process axis. And ask what aspect ratio the true shape might have. Between 1.98 and 2.08, the method silently stopped reporting one of its two dimensions.

The 81 x 39 grid embeds smoothly and is provably one dimension short.

The horseshoe in the 2005 House of Representatives was made by the method

In 2005 the US House of Representatives held 671 roll calls among 435 members. Diaconis and colleagues dropped the first two — a call of the House by States and the election of the Speaker — and kept the 401 Representatives who voted on at least 90% of the rest: 220 Republicans, 180 Democrats and 1 Independent, Rep. Bernie Sanders. Classical MDS on that 401 x 669 matrix returned a three-dimensional embedding. It separated into what they call “twin horseshoes”, one per party.

The curve is the kind of picture that gets a story attached to it: a political spectrum bending back on itself, moderates meeting at the far end. The story is unnecessary, and in 2008 they proved it. Their abstract: “We show that, in general, a latent ordering of the data gives rise to these patterns when one only has local information. That is, when only the interpoint distances for nearby points are known accurately.” The horseshoe is a property of the distance model, not of the legislators.

Meilă and Zhang state the reading rule that follows: “when an embedding looks like a 'horseshoe', this may not represent a property of the data, but an artifact signalling that one of the data dimensions is collapsed, or poorly reflected in the embedding (Diaconis et al., 2008)”.

Hand the same matrix to the other families and each answers a different geometric question. Classical MDS fits coordinates to a supplied dissimilarity matrix. Isomap follows shortest paths through a neighbourhood graph. LLE preserves the weights that reconstruct each point from its neighbours. Diffusion maps preserve connectivity under repeated random-walk transitions. All four can return a plausible two-dimensional picture of the same data. Calling them collectively “nonlinear PCA” hides the assumption that decides which picture means anything.

A nonlinear embedding is defined by the relation it tries to preserve.

Case

698 face images, 4,096 numbers each, and three recovered axes

The best case for the whole idea is a set of rendered faces. Tenenbaum and colleagues ran Isomap on “64 pixel by 64 pixel images of a face rendered with different poses and lighting directions”, each image entering the method as one of the “4096-dimensional vectors”. The result, reported in Science in 2000: “Applied to N = 698 raw images, Isomap (K = 6) learns a three-dimensional embedding”. Its axes track “left-right pose (x axis, R = 0.99), up-down pose (y axis, R = 0.90), and lighting direction (slider position, R = 0.92)”.

It is worth stating that precisely, because it fixes what a success looks like. 698 points. 4,096 measured dimensions. Three interpretable coordinates. Correlations against generating parameters that were known independently of the embedding. The generating parameters existed because the faces were rendered. Where they do not exist, the same three-axis picture arrives with nothing to correlate it against.

Analogy

Learning a country from roads, and what 2% noise did to the Swiss roll

Straight-line distance, road distance, local street layouts, and the probability that a traveller reaches one town after several steps each describe the same country. Each description supports a different map. Surveyed roads, though, are known objects. Data neighbourhoods are inferred from noisy measurements, and the inference can invent a road.

On 4 January 2002 Science ran a technical comment on Isomap. Balasubramanian and Schwartz had added zero-mean Gaussian noise to the original 1,000-point Swiss roll, with a standard deviation of 2% of the smallest bounding-box dimension. At epsilon = 5, Isomap produced gross folds. Their diagnosis: “Even a single short-circuit error can alter many entries in the geodesic distance matrix, which in turn can lead to a drastically different (and incorrect) low-dimensional embedding.”

In the printed response the Isomap authors accepted the mechanism and put numbers around it. Epsilon between 4.3 and 4.6 restores a topology-preserving embedding. At 1,000 points the method tolerates noise up to roughly 12% of the separation between branches of the manifold, and 20% at 2,000 points. LLE, they noted, “suffers from the same problem of short-circuit edges”.

Two figures do the teaching here. The neighbourhood parameter moved from 5 to the 4.3–4.6 band and the embedding changed character. The tolerated noise doubled from 12% to 20% purely by doubling the sample. Neither number is a property of the data alone.

The scikit-learn user guide still carries the same warning to anyone reaching for the shipped implementation: “Note that noisy data can 'short-circuit' the manifold, in essence acting as a bridge between parts of the manifold that would otherwise be well-separated. Manifold learning on noisy and/or incomplete data is an active area of research.”

Neighborhood construction is part of the model, not neutral preprocessing.

Visual

Four preservation goals, and the dial each one hands you

Manifold methods differ less by their final plot than by the geometry optimized before plotting. Each objective also comes with a setting that has to be chosen before any picture exists.

Classical MDS finds coordinates whose Euclidean distances approximate a supplied dissimilarity matrix. The dissimilarity matrix is the input, which is why the 401 x 669 roll-call matrix and its twin horseshoes are an MDS result rather than a fact about the House. Isomap approximates geodesic distance through a neighbourhood graph and then embeds those graph distances; its dial is the neighbourhood, K = 6 for the 698 faces, epsilon = 5 versus 4.3–4.6 for the noisy Swiss roll. Locally linear embedding preserves the coefficients that reconstruct each point from nearby points; its dials are K and the regularizer that keeps those coefficients unique. Diffusion maps preserve connectivity under repeated random-walk transitions; their dials are the kernel width, sigma = 2 in the Goldberg experiments, and the normalization exponent alpha, which decides which operator is being approximated at all.

FigureHierarchy · 4 levels
  • Classical MDS

    Find coordinates whose Euclidean distances approximate a supplied dissimilarity matrix.

    • Isomap

      Approximate geodesic distance through a neighborhood graph, then embed those graph distances.

      • Locally Linear Embedding

        Preserve coefficients that reconstruct each point from nearby points.

        • Diffusion maps

          Preserve connectivity under repeated random-walk transitions at a chosen diffusion scale.

The objective determines what “nearby” means after reduction.

Comparison

What each family preserves — and the published price of preserving it

A method can satisfy its own objective while distorting a relation another method values. In each family the cost has been measured rather than merely predicted.

MDS fits distances from an explicit dissimilarity matrix. That makes global stress visible and admits non-Euclidean input in some variants, but it discovers no geodesics on its own. On the 2005 House matrix it produced the twin horseshoes that were later proved to come from having only local distances accurate.

Isomap targets global manifold geometry through shortest paths, and pays for it twice. De Silva and Tenenbaum named the two bottlenecks when they introduced Landmark Isomap at NIPS in 2002: the all-pairs shortest-path matrix, and an MDS eigenvalue calculation on a full N x N matrix. “In contrast, the eigenvalue computations in LLE and Laplacian Eigenmaps are sparse (hence considerably cheaper).” Their fix replaces the N x N distance matrix with an n x N matrix of distances to n landmark points. Meilă and Zhang put the asymptotics on it: “Computation complexity of Isomap is O(n3), with a most computational burden for computing all pairs of shortest path distance. Space complexity is O(n2). Since Isomap works with dense matrices, this space complexity cannot be improved.” The shipped implementation agrees, giving “The overall complexity of Isomap is O[D log(k) N log(N)] + O[N^2(k + log(N))] + O[d N^2]” against “The overall complexity of standard LLE is O[D log(k) N log(N)] + O[D N k^3] + O[d N^2]” (scikit-learn, “Manifold learning”). And Isomap remains the family that a single false edge can reorganize.

LLE focuses on local patch geometry and avoids explicit global distance fitting. Its local step, though, is ill-posed rather than merely delicate. Once the neighbourhood size K exceeds the input dimensionality D, each point is reconstructed perfectly from its neighbours and the weights stop being unique. The local Gram matrix then has to be conditioned by adding a multiple of the identity. Saul and Roweis used a regularizer of Δ = 0.1 for the synthetic manifolds of their Figure 1, where K = 8 exceeded D = 3, and reported in 2003 that “The results are stable over a wide range of values but do break down as K becomes too small or large.” The same conditioning is a tuning knob in the library: “reg float, default=1e-3 — Regularization constant, multiplies the trace of the local covariance matrix of the distances”, with n_neighbors defaulting to 5. A default of 5 neighbours and 1e-3 is a modelling decision someone already made for you.

Diffusion maps can suppress short-scale noise and offer a scale parameter through diffusion time. They are also not one construction. In PNAS in 2005, Coifman, Lafon and five colleagues showed that they are a one-parameter family indexed by a normalization exponent: “One can easily see that the interesting cases are (i) α = 0, corresponding to the classical normalized graph Laplacian; (ii) α = 1, yielding the Laplace–Beltrami operator; and (iii) α = 1/2 yielding the backward Fokker–Planck operator.” At alpha = 1 the sampling density plays no role. Meilă and Zhang record the consequence: “The seminal work Coifman & Lafon (2006), which introduced renormalization, showed that in this case, the eigenvectors of Lnorm, Lrw are biased by the sampling density and that renormalization removes this bias.” That is why every honest report of a diffusion-map coordinate states the exponent, as the grid experiments above do: “We ran the DFM algorithm on the same data sets. We used the normalization constant α = 1 and the kernel width σ = 2; the results for σ = 1,4, and 8 are similar.” Whether a coordinate reports geometry or reports where you happened to sample is decided by a number chosen before the run.

FigureComparison · 4 columns

MDS

Distance-fitting from an explicit dissimilarity matrix.

  • Supports non-Euclidean input dissimilarities in some variants
  • Makes global stress visible
  • Can be expensive for large sample counts
  • Does not discover geodesics automatically

Isomap

Shortest paths through a neighborhood graph.

  • Targets global manifold geometry
  • Fails when graph shortcuts cross folds
  • Struggles with disconnected components
  • Depends strongly on neighborhood construction

LLE

Local affine reconstruction relationships.

  • Focuses on local patch geometry
  • Avoids explicit global distance fitting
  • Can become unstable with sparse or ill-conditioned neighborhoods
  • May fold distant regions together

Diffusion maps

Multi-step transition connectivity.

  • Can suppress short-scale noise
  • Provides a scale parameter through diffusion time
  • Depends on kernel bandwidth and density effects
  • Coordinates need not have a simple domain meaning

Case

The LLE claim that no local minima stand in the way

Locally linear embedding arrived with a promise about its optimisation, not only about its pictures. Roweis and Saul introduced it in the same issue of Science as Isomap, in 2000. The algorithm “computes low-dimensional, neighborhood-preserving embeddings of high-dimensional inputs”, and “LLE maps its inputs into a single global coordinate system of lower dimensionality, and its optimizations do not involve local minima”.

That is a contract, not a result. It promises that the answer you get is the answer the objective defines, with no seed-dependent basin to escape. It promises nothing about whether the objective was the right one. The same family collapsed the 81 x 39 grid. It needed Δ = 0.1 to keep its weights unique at K = 8 with D = 3. And in the words of the 2002 Science exchange, it “suffers from the same problem of short-circuit edges”. A convex-looking guarantee about the optimisation is not a guarantee about the geometry.

Example

Where manifold assumptions become testable

Applying one of these usefully means naming both the hypothesized manifold and the evidence that would challenge it. The published failures name that evidence for you.

  • Motion capture: check that local neighbourhoods follow physical pose continuity rather than clothing, actor identity or camera setup, and ask whether the true configuration space is a long thin strip — the grids above lost a dimension between aspect ratios 1.98 and 2.08.
  • Chemical spectra: test whether diffusion coordinates track gradual mixture changes while remaining stable across instrument batches, and record alpha and sigma in the write-up, since alpha = 0, 1/2 and 1 approximate three different operators.
  • Robotics: use Isomap only after verifying that neighbourhood edges do not connect configurations separated by an obstacle. Adding 2% noise to the 1,000-point Swiss roll was enough to fold it at epsilon = 5, and doubling the sample only moved the tolerance from about 12% to 20%.
  • Single-cell analysis: compare embeddings across preprocessing, neighbourhood sizes, donors and batch-correction choices before naming trajectories, and treat a horseshoe as an artifact of the method until something rules it out.
  • Image collections: the 698 rendered faces recovered pose at R = 0.99, 0.90 and 0.92 because the generating parameters were known. Without such an external variable, a smooth pose arc stays a hypothesis, and illumination or background may be the competing direction.

Steps

Audit a manifold-learning experiment

The workflow separates geometric assumptions from visual preference. Every step below has a number attached to it somewhere in this lesson.

1. Define the preserved relation. Choose global dissimilarity, graph geodesic, local reconstruction or diffusion connectivity before looking at any plot. The 401 x 669 roll-call horseshoe is what happens when the relation is chosen implicitly.

2. Build competing neighbourhoods. Vary the metric, the scaling, the neighbour count, the radius and the approximate-search settings. K = 6 recovered the faces; K = 8 with D = 3 forced Saul and Roweis to add Δ = 0.1; epsilon moved from 5 to the 4.3–4.6 band between a broken and a working Swiss roll.

3. Inspect graph pathology. Measure components, degree distribution, hubs, shortcuts and isolated observations. A single short-circuit edge can alter many entries of the geodesic distance matrix at once.

4. Quantify preservation, and quantify cost. Use stress, reconstruction error, neighbour retention and domain-specific continuity checks. Budget for O(n^3) time and O(n^2) space if the method is Isomap, or move to landmarks — an n x N matrix instead of N x N.

5. Challenge the interpretation. Repeat across seeds, samples, batches and plausible preprocessing choices, and test the aspect-ratio failure specifically. An embedding that looks one-dimensional may be a two-dimensional manifold the normalized-output family refuses to report.

FigureProcess · 5 steps
  1. 1. Define the preserved relation

    Choose global dissimilarity, graph geodesic, local reconstruction, or diffusion connectivity.

  2. 2. Build competing neighborhoods

    Vary metric, scaling, neighbor count, radius, and approximate-search settings.

  3. 3. Inspect graph pathology

    Measure components, degree distribution, hubs, shortcuts, and isolated observations.

  4. 4. Quantify preservation

    Use stress, reconstruction error, neighbor retention, and domain-specific continuity checks.

  5. 5. Challenge interpretation

    Repeat across seeds, samples, batches, and plausible preprocessing choices.

Nonlinear reduction is a family of hypotheses about geometry

MDS, Isomap, LLE and diffusion maps do not offer interchangeable routes to the same hidden plane. Each constructs a different contract between the original space and the embedding, and each contract has a published price. A horseshoe that a theorem attributes to the method rather than to the House of Representatives. A two-dimensional grid collapsed to a curve once its aspect ratio passed 2, with no sample size that repairs it. An embedding reorganized by one false edge under 2% noise. Reconstruction weights that stop being unique the moment K exceeds D. A dense N x N eigenproblem whose O(n^2) space cannot be improved. A normalization exponent that decides whether a coordinate describes geometry or sampling density.

Select the method from that contract, not from the most attractive scatterplot. When no contract matches the task, a simpler representation may be more honest.

Choose the geometry first; evaluate the picture second.

Key takeaways