Dimensionality reduction: PCA, t-SNE, UMAP and LDA
Real data often has dozens or thousands of columns (called dimensions or features). Dimensionality reduction squeezes them into a few new columns that keep the most important information. That makes data easier to see on a chart, faster to train on and less noisy.
Everyday analogy
A shadow. A 3D object casts a 2D shadow on the wall. If you choose the angle well, you can still tell a hand from a bird. PCA picks the angle that keeps the most detail.
Example
A shop has 50 facts about each customer: visits, spend, categories, times of day and more. PCA boils them down to 2 new columns, roughly how much they spend and how often they visit. Plotted on a chart, clear customer groups appear that were invisible in the 50-column spreadsheet.
| Method | How it works (simply) | Labels needed? | Best for |
|---|---|---|---|
| PCA (Principal Component Analysis) | Finds the directions where the data varies most and keeps only the top few | No | Compressing data before training, removing noise, quick overviews |
| t-SNE | Places similar items close together on a 2D map, focusing on near neighbours | No | Visualising clusters, e.g. word or image embeddings |
| UMAP | Like t-SNE but faster, and keeps more of the big-picture layout | No | Visualising large datasets |
| LDA (Linear Discriminant Analysis) | Finds the directions that best separate known groups | Yes | Simple classification and separating classes |
Strengths
- Turns huge tables into pictures you can understand
- Faster training with fewer columns
- Can remove noise and repeated information
Watch out for
- The new columns are mixes of the old ones, so they're harder to explain
- On t-SNE maps, the distance between clusters and their sizes don't mean much
- Some information is always lost
Don't mix up the two LDAs: in machine learning, LDA usually means Linear Discriminant Analysis (this lesson). In NLP, LDA can also mean Latent Dirichlet Allocation, a method that finds topics in documents.
Try it yourself
About 10 minReduce 10 facts to 2
- Write 10 facts about 6 friends (age, height, sports per week, books per year, coffee per day and so on).
- Combine them into just 2 scores, e.g. active and bookish.
- Plot your friends on a 2D chart using the two scores.
What you should see: Two well-chosen combined scores show the groups clearly, which is the idea behind PCA.
Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.