Skip to content

Clinic 18

Manifold Choice

PCA, UMAP, and t-SNE on the same 50k-row embedding table. Three plots, three different stories. Pick the method you trust for the claim you are about to make.

Situation

Three Plots Disagree

PCA shows two elongated clouds. UMAP shows seven small islands. t-SNE shows one big swirl. Which do you put in the deck?

Your Job

Pick A Manifold Method

Defend the method for the claim you want to make. Different claims license different methods — that is the whole clinic.

Bad Habit To Avoid

When The Picture Is Too Clean

The most aesthetically separated plot is not automatically the most informative one. The downstream claim decides which method earns the slide.

Situation

You have 50,000 embeddings (dimension 384) from a sentence encoder applied to customer-support tickets. The product team wants a slide: "here's the structure of our ticket corpus."

You run three methods to 2D with defaults:

  • PCA(n_components=2) — 12.3% explained variance; plot shows two elongated blobs separated along axis-1
  • UMAP(n_neighbors=15, min_dist=0.1) — plot shows 7 clearly separated islands with some stragglers
  • t-SNE(perplexity=30) — plot shows one big swirl with hints of sub-structure inside

Three different "stories" are available:

  • PCA's story: the corpus is two broad themes, one varying along a long axis
  • UMAP's story: the corpus has seven distinct topic clusters, discoverable by eye
  • t-SNE's story: the corpus is one continuous space with soft sub-populations

The product team will make routing decisions based on this slide. A "seven clusters" picture justifies seven specialist queues. A "two themes" picture justifies a generalist-plus-triage model. The method you pick will propagate.

Artifact Packet

What the three methods actually optimize:

method preserves distorts typical misread
PCA global variance axes; distances up to rotation nonlinear structure — a curved manifold looks like a smear under-reports cluster count when the signal is off-axis
UMAP local neighborhood topology; some global structure between-cluster distances (islands look equally far apart regardless of truth) "islands" become the story when perplexity/n_neighbors is small
t-SNE local density; near-neighbor order all global distance; cluster sizes are not meaningful reports "clusters" that are purely perplexity artifacts

Diagnostic facts you can compute quickly:

  • PCA explained variance ratio: [0.082, 0.041] — only 12.3% of variance is in the 2D view
  • silhouette score on UMAP clusters (k=7, KMeans): 0.41 — "decent" looking but not strong
  • silhouette score on raw 384-D space for the same k=7 labels: 0.12 — very weak in the original space
  • t-SNE KL-divergence at convergence: 0.87 — middling; try perplexity sweep before trusting

The gap between 0.41 (on UMAP's 2D) and 0.12 (on 384-D) is the tell: UMAP's 7 islands are amplified by the projection, not fully earned by the data.

Decision Prompt

Write a six-sentence defense that answers:

  1. Which method do you put in the deck, and paired with which claim?
  2. How do you justify it against the two you rejected?
  3. What single number or side-by-side plot will you show alongside the chosen projection so the viewer understands its limits?
  4. What parameter sweep would change your choice?
  5. If the product team pushes for "seven queues," what evidence would make you agree?
  6. What is the analogous failure to the "seven clusters from UMAP" mistake — i.e., the PCA or t-SNE version of the same trap?

Strong Reasoning Looks Like

  • pairs method to claim: PCA if the claim is about global variance or axes; UMAP if about local topology or neighbor structure; t-SNE if about near-neighbor density only
  • refuses to put the UMAP "seven islands" in a routing-decision deck without a companion silhouette / cluster-stability analysis on the raw 384-D space
  • shows the companion artifact: PCA explained-variance chart alongside UMAP 2D, or a parameter sweep (UMAP with n_neighbors ∈ {5, 15, 50, 200}) to show that cluster count changes with the knob
  • names the sweep: if the UMAP cluster count is stable across n_neighbors ∈ {15, 30, 50}, the structure is real; if it collapses from 7 to 3 at n_neighbors=50, it is a local artifact
  • treats "seven queues" as a decision that needs a raw-space silhouette ≥ 0.3 or a stability score across seeds ≥ 0.8, not a screenshot of UMAP
  • acknowledges that t-SNE and UMAP look more decisive than they are — that is their design

Common Wrong Moves

  • putting the UMAP "seven islands" plot in the deck without the raw-space silhouette number
  • reading cluster sizes off t-SNE and treating them as proportional to the underlying data — t-SNE's areas are not meaningful
  • declaring "the data is continuous" from t-SNE's swirl when the perplexity was not swept
  • declaring "only two themes" from PCA's 12%-variance plot — global linear projection missing nonlinear structure is the PCA version of the same trap UMAP has
  • using the same method for both the slide and the downstream clustering — the projection that reads best to the human is not necessarily the one that clusters best
  • skipping random_state in t-SNE/UMAP and showing one seed — the "islands" often reshuffle between seeds

Run The Clinic In Browser

Use the runner to produce the three projections on a sample, plus a UMAP n_neighbors sweep and a silhouette comparison between the 2D view and the raw space.

Reference Reveal

Open only after you write the defense The reference choice is **PCA for the executive slide, UMAP as a companion exploratory plot, t-SNE not in the deck**. Why: - the claim "here is the structure of our ticket corpus" is a *global* claim. PCA is the only one of the three that has a faithful global-structure interpretation (axes of maximum variance). - the PCA plot's low explained variance (12.3%) is itself informative — it tells the viewer "the space is genuinely high-dimensional; no 2D view captures the full story." That honesty belongs in the deck. - UMAP's seven islands are the most visually compelling, but the raw-space silhouette of those clusters (0.12) is too low to justify seven specialist queues. Including UMAP as a companion plot — with the parameter sweep showing cluster count change — is the honest use. - t-SNE is a local-neighbor inspection tool. It is useful at the analyst's desk, not on a product slide, because its distances and cluster sizes carry no interpretable meaning. What the slide should actually show: - left panel: PCA 2D with "12.3% variance explained" label - right panel: UMAP 2D with a note "local topology only; cluster count varies with `n_neighbors` from 4 to 9" - a single number under the plots: "raw-space silhouette for 7 clusters: 0.12 → no strong evidence for discrete topic groups" Decision trigger for "seven queues": - raw-space silhouette ≥ 0.3 for k=7, AND - stability index (ARI across 10 UMAP seeds) ≥ 0.7 for k=7, AND - manual inspection of 20 tickets per cluster agrees with the labels If any of those fails, push back on the seven-queue plan and propose a hierarchical triage instead — two broad themes (from PCA) with soft sub-routing. Parameter guidance: - UMAP: sweep `n_neighbors ∈ {5, 15, 30, 50, 100}` and `min_dist ∈ {0.0, 0.1, 0.5}`. Structure that survives is real; structure that changes is an artifact. - t-SNE: sweep `perplexity ∈ {5, 30, 50, 200}`. If the cluster count changes, no cluster count is trustworthy. - PCA: check the cumulative explained variance curve; if 2D captures < 30%, the projection is a coarse summary, not a map. The practical lesson: **manifold methods answer different questions**. PCA: "what are the global axes?" UMAP: "which points are neighbors?" t-SNE: "where is the local density?" A plot that answers the wrong question is not a less precise answer — it is a different answer.

What To Do Next

  1. open Dimensionality Reduction for the method-to-claim mapping in detail
  2. open Advanced Clustering and Dimensionality Reduction for the stability discipline
  3. open Cluster Stability for the companion clinic on seed-driven cluster drift
  4. rerun all three methods on your data with parameter sweeps; if the cluster count changes with knob settings, the cluster count is a knob output, not a finding