All labs

Clustering Through the Graph Laplacian

Non-convex shapes that defeat k-means fall apart cleanly in the spectral embedding.

Ch 8 8.5
Explorer
Unsupervised Learning & Text
22 mindifficulty 4/5

Controls

Dataset
100
0.080

Perturbation added to the generating curve.

Affinity graph
0.250

Controls how quickly similarity decays with distance.

2
Random seed

Every result on this page is a deterministic function of the seed and the controls.

Spectral clustering

Points colored by cluster label from the graph embedding.

-1-0.5000.5011.50-1012xy

k-means in original space

Same points; Euclidean k-means fails on non-convex shapes.

-1-0.5000.5011.50-1012xy

Spectral embedding

Fiedler vector (2nd eigenvector) vs the 3rd, colored by spectral label.

-0.10-0.0500.050.100.150.040.060.080.100.120.14u2 (Fiedler)u3

Eigenvalue spectrum

Smallest eigenvalues of the normalized Laplacian; the eigengap is highlighted.

00.100.200.300.400.500246810[0, 1) n=1[1, 2) n=1[2, 3) n=1[3, 4) n=1[4, 5) n=1[5, 6) n=1[6, 7) n=1[7, 8) n=1[8, 9) n=1[9, 10) n=1eigengapindexeigenvalue
Eigengap
0.2093
largest jump after index 4
Bandwidth σ
0.250
Spectral vs truth (ARI)
0.543
adjusted Rand index
k-means vs truth (ARI)
0.404
Euclidean k-means, same k
Read the eigengap

The number of near-zero eigenvalues of the normalized Laplacian is (approximately) the number of well-separated clusters in the affinity graph. A large jump — the eigengap — after the k-th eigenvalue is evidence that k clusters is the right choice; a small, ambiguous gap means the graph does not cleanly separate into k pieces.