AI Dimensionality Reduction Tutorial: Pca, T-Sne, Umap
TL;DRDimensionality reduction (PCA, t-SNE, UMAP) compresses many features into a few.
High-dimensional data is hard to model and visualize. PCA finds the directions of greatest variance and projects onto them (linear, fast, great for preprocessing). t-SNE and UMAP are nonlinear, made for visualizing clusters in 2D/3D — but their distances/sizes can mislead. Use PCA to reduce features for models; t-SNE/UMAP to look at structure, not to measure it.
Key points
Compress many features into few
PCA: linear, variance-preserving, preprocessing
t-SNE/UMAP: nonlinear, for visualization
t-SNE/UMAP distances can mislead
Common mistakes
Reading t-SNE cluster sizes/distances literally
Skipping scaling before PCA
Using t-SNE output as model features
Try it: Choose PCA vs t-SNE for: feeding a model vs eyeballing clusters.
Example code
<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>reduce features for a model → PCA
visualize clusters in 2D → t-SNE / UMAP
(don’t trust t-SNE distances)</pre></body></html>