Nonlinear dimension reduction

Math 123: Mathematical Aspects of Data Analysis – Fall 2026

Published

November 5, 2026

Where we are

Last time we finished normalized spectral clustering. We embedded each vertex \(i\) as the row \((\phi_1(i),\ldots,\phi_k(i))\), where \(\bfphi_\ell=\bfD^{-1/2}\bfv_\ell\) and \(\bfv_1,\ldots,\bfv_k\) are eigenvectors of the normalized Laplacian \(\bfL_{\mathrm{sym}}=\bfI-\bfD^{-1/2}\bfW\bfD^{-1/2}\) for its \(k\) smallest eigenvalues, and then rounded the rows to a partition with \(k\)-means.

Today we start a new topic: finding low-dimensional coordinates for data that lie on a curved surface, where PCA fails. We will see two methods, which make opposite choices about what to keep.

  1. Laplacian eigenmaps (Belkin and Niyogi 2003) keep only local information: neighbours should stay close. The method uses the same eigenvectors as spectral clustering, kept as coordinates instead of rounded to a partition. We have already done the hard work, so we move quickly.
  2. Isomap (Tenenbaum et al. 2000) keeps global information: every pairwise distance, measured along the data. It is built on classical multidimensional scaling, which recovers points from their pairwise distances and turns out to be PCA in disguise. We cover it in Lecture 18.

Throughout, \(G\) is a weighted graph with no isolated vertices, as in Lecture 16.

Why nonlinear?

PCA finds the best subspace, so it can only find structure that is linear. Many datasets have few degrees of freedom but are curved:

  • A swiss roll: a rectangle of points rolled up in \(\Rbb^3\). It is intrinsically two-dimensional, but any projection to a plane stacks the layers on top of each other.
  • Images of a moving stripe: a white vertical stripe on a black background, at \(n\) horizontal positions, wrapping around at the edge. Each image is a vector in \(\Rbb^{\text{pixels}}\), but the data have one degree of freedom and the shape of a circle. Two images with non-overlapping stripes are equally far apart, whatever their positions, so Euclidean distance only sees which images are nearby.
  • Faces under changing light: one face photographed with the light at different angles, two degrees of freedom (Section 6.1.3 of the textbook).

The working assumption, the manifold hypothesis, is that the data lie on or near a smooth \(m\)-dimensional surface in \(\Rbb^d\), with \(m\ll d\). On such a surface, Euclidean distance is trustworthy only between nearby points: two points on adjacent layers of the swiss roll are close in \(\Rbb^3\) but far apart along the roll. So we keep only local information, in a similarity graph, and ask for coordinates in which neighbours stay close.

See the swiss roll example for PCA failing, and the method below succeeding, on exactly this problem.

Laplacian eigenmaps

We want to place each vertex \(i\) at a point \(\bfy_i\in\Rbb^m\), with \(m\) small, so that vertices joined by heavy edges land close together. Collect the points as the rows of \(\bfY\in\Rbb^{n\times m}\) and measure the failure by the energy \[ E(\bfY)=\frac12\sum_{i,j=1}^nw_{ij}\|\bfy_i-\bfy_j\|_2^2=\operatorname{tr}(\bfY^\top\bfL\bfY), \] which is the Laplacian quadratic form applied to each column of \(\bfY\).

On its own, \(E\) is minimized by cheating: shrink everything to \(\bfY=\mathbf{0}\), collapse every point to one point, or repeat one good column \(m\) times. The same degree-weighted constraints as for the relaxed normalized cut rule these out, \[ \bfY^\top\bfD\mathbf{1}=\mathbf{0}, \qquad \bfY^\top\bfD\bfY=\bfI_m. \] The first removes translation, and the second fixes the scale of each coordinate and stops different coordinates from repeating each other.

Theorem 1 (The smoothest embedding) Let \(\bfL_{\mathrm{sym}}\) have eigenvalues \(\lambda_1\leq\cdots\leq\lambda_n\) with orthonormal eigenvectors \(\bfv_1,\ldots,\bfv_n\), and let \(\bfphi_\ell=\bfD^{-1/2}\bfv_\ell\). For every \(\bfY\in\Rbb^{n\times m}\) with \(\bfY^\top\bfD\mathbf{1}=\mathbf{0}\) and \(\bfY^\top\bfD\bfY=\bfI_m\), \[ \frac12\sum_{i,j=1}^nw_{ij}\|\bfy_i-\bfy_j\|_2^2\geq\lambda_2+\cdots+\lambda_{m+1}, \] with equality at \(\bfY=[\bfphi_2,\ldots,\bfphi_{m+1}]\).

Proof. This is the proof of the relaxed normalized cut, with \(m\) columns instead of one. Set \(\bfZ=\bfD^{1/2}\bfY\). Then \(\bfZ^\top\bfZ=\bfI_m\), \(\bfZ^\top\bfv_1=\mathbf{0}\) since \(\bfv_1=\bfD^{1/2}\mathbf{1}/\sqrt{\operatorname{vol}(V)}\), and \(\operatorname{tr}(\bfY^\top\bfL\bfY)=\operatorname{tr}(\bfZ^\top\bfL_{\mathrm{sym}}\bfZ)\). By Rayleigh–Ritz with the constraint \(\bfZ^\top\bfv_1=\mathbf{0}\), this is at least \(\lambda_2+\cdots+\lambda_{m+1}\), with equality at \(\bfZ=[\bfv_2,\ldots,\bfv_{m+1}]\).

Definition 1 (Laplacian eigenmap) The Laplacian eigenmap of \(G\) in \(m\) dimensions sends vertex \(i\) to \[ \bfy_i=\big(\phi_2(i),\ \ldots,\ \phi_{m+1}(i)\big)\in\Rbb^m, \] where \(\bfphi_\ell=\bfD^{-1/2}\bfv_\ell\) and \(\bfv_2,\ldots,\bfv_{m+1}\) are orthonormal eigenvectors of \(\bfL_{\mathrm{sym}}\) for its smallest eigenvalues after \(\lambda_1=0\).

A few things to notice.

  • Only neighbours enter. The energy involves \(w_{ij}\), which is negligible unless \(i\) and \(j\) are close in the data. Nothing asks distant points to be far apart; the constraint \(\bfY^\top\bfD\bfY=\bfI_m\) does that implicitly, by forbidding collapse.
  • Up to rotation. For orthogonal \(\bfQ\in\Rbb^{m\times m}\), the matrix \(\bfY\bfQ\) satisfies the same constraints and has the same energy, by the cyclic property of the trace. So the eigenmap is the smoothest embedding up to a rotation or reflection of \(\Rbb^m\).
  • Each coordinate is ranked by roughness. Coordinate \(\bfphi_\ell\) has energy \(\bfphi_\ell^\top\bfL\bfphi_\ell=\lambda_\ell\), so the first coordinates are the smoothest functions on the graph.

Spectral clustering is k-means on the eigenmap

Compare the spectral embedding with the Laplacian eigenmap (Definition 1). The eigenmap with \(m=k-1\) coordinates is the spectral embedding with the constant first coordinate \(\phi_1(i)=1/\sqrt{\operatorname{vol}(V)}\) removed, and removing it changes no distance between rows, and so nothing about \(k\)-means. So normalized spectral clustering is \(k\)-means on the Laplacian eigenmap with \(m=k-1\) coordinates, and the same eigenvectors serve two purposes:

Use What we do with \(\bfphi_2,\ldots,\bfphi_{m+1}\)
Clustering round to a partition with \(k\)-means, \(m=k-1\)
Dimension reduction plot or analyze the coordinates directly

The proof of Theorem 1 also gives the \(k\)-cluster version of the relaxed normalized cut.

Proposition 1 (Relaxed normalized cut for \(k\) clusters) For every partition of \(V\) into non-empty sets \(C_1,\ldots,C_k\), \[ \sum_{\ell=1}^k\frac{\operatorname{cut}(C_\ell)}{\operatorname{vol}(C_\ell)}\geq\lambda_1+\cdots+\lambda_k, \] and the relaxed problem, over all \(\bfY\in\Rbb^{n\times k}\) with \(\bfY^\top\bfD\bfY=\bfI_k\), is solved by \(\bfY=[\bfphi_1,\ldots,\bfphi_k]\). For \(k=2\) the left side is \(\operatorname{Ncut}(C_1)\) and the right side is \(\lambda_2\).

Proof. Let \(\bfH\in\Rbb^{n\times k}\) have columns \(\bfh_\ell=\mathbf{1}_{C_\ell}/\sqrt{\operatorname{vol}(C_\ell)}\). The columns have disjoint supports, and \(\bfh_\ell^\top\bfD\bfh_\ell=\sum_{i\in C_\ell}\deg(i)/\operatorname{vol}(C_\ell)=1\), so \(\bfH^\top\bfD\bfH=\bfI_k\). By the Laplacian quadratic form, only edges leaving \(C_\ell\) contribute to \(\bfh_\ell^\top\bfL\bfh_\ell\), each with \(1/\operatorname{vol}(C_\ell)\), so \(\operatorname{tr}(\bfH^\top\bfL\bfH)=\sum_\ell\operatorname{cut}(C_\ell)/\operatorname{vol}(C_\ell)\). Now repeat the proof of Theorem 1 without the constraint \(\bfY^\top\bfD\mathbf{1}=\mathbf{0}\): with \(\bfZ=\bfD^{1/2}\bfY\), Rayleigh–Ritz gives \(\operatorname{tr}(\bfY^\top\bfL\bfY)\geq\lambda_1+\cdots+\lambda_k\) with equality at \(\bfZ=[\bfv_1,\ldots,\bfv_k]\). Apply this to \(\bfY=\bfH\).

Laplacian eigenmaps on data

For a point cloud \(\bfx_1,\ldots,\bfx_n\in\Rbb^d\), build a similarity graph and take its eigenmap.

  • The graph decides everything. Too many neighbours, or too large an \(\varepsilon\) in the Gaussian weights, and the swiss roll’s layers get connected across, which the embedding then faithfully reports. Too few, and the graph falls apart into pieces, and by the disconnected case the first eigenvectors just report the pieces. A sparse \(k\)-nearest-neighbour graph is the usual choice.
  • Noise: pairwise distances in high dimension are dominated by noise, so a common pipeline first reduces to a few dozen principal components and then builds the graph there.
  • Computation: with a sparse graph, only a few of the smallest eigenvectors are needed, and an iterative sparse eigensolver finds them without forming a dense \(n\times n\) decomposition.
TipLaplacian eigenmaps in NumPy

The eigenmap is the spectral clustering embedding without the constant first column.

import numpy as np


def normalized_spectral_embedding(W, k):
    d = W.sum(axis=1)
    L_sym = np.eye(len(d)) - W / np.sqrt(np.outer(d, d))
    lam, V = np.linalg.eigh(L_sym)  # increasing order
    return lam[:k], V[:, :k] / np.sqrt(d)[:, None]  # phi_l = D^{-1/2} v_l


lam, Phi = normalized_spectral_embedding(W, m + 1)
Y = Phi[:, 1:]  # rows are the points y_i in R^m

scikit-learn’s SpectralEmbedding does the same, with a nearest-neighbour graph by default.

Next time

The eigenmap keeps only local information. In Lecture 18 we make the opposite choice: classical MDS recovers points from all of their pairwise distances, and Isomap feeds it distances measured along the data.

References

Belkin, Mikhail, and Partha Niyogi. 2003. “Laplacian Eigenmaps for Dimensionality Reduction and Data Representation.” Neural Computation 15 (6): 1373–96.
Tenenbaum, Joshua B., Vin de Silva, and John C. Langford. 2000. “A Global Geometric Framework for Nonlinear Dimensionality Reduction.” Science 290 (5500): 2319–23.