The one idea: Both PCA and LDA compress a dataset from many columns down to a few, but they optimize for different things — PCA finds the directions where the data spreads out the most (it never looks at labels), while LDA finds the directions that separate your classes the best (it requires labels). Picking the wrong one for the job is the single most common mistake: using PCA when you actually want class separation, or using LDA when you don't have — or don't trust — your labels.
⚠️ The trap: A principal component is a number produced by a formula (a weighted blend of your original columns), not a discovery about the business. It's tempting to eyeball the weights of "PC1" and declare "this is a customer-value score" — that feels right and it's often wrong. PCA doesn't know what your columns mean; it only knows their variance. A component that mixesage,zip code, andemail domain lengthwith similar weight isn't secretly measuring anything real — it's just the direction those three happened to co-vary in on this particular sample.
Almost every dataset with more than a handful of columns has columns that move together — order count and total spend, height and shoe size, screen time and app opens. When columns are correlated, you're paying for more dimensions than you're actually getting information from. Dimensionality reduction is the general fix: replace many correlated columns with a few new ones that capture most of what mattered, so downstream models train faster, overfit less, and are easier to visualize.
PCA and LDA are the two classic linear ways to do this,…
Keep reading: PCA and Lda
Unlock the full Machine Learning track — every lesson, the AI tutor, and full mock assessments.
- Full lesson content
- AI tutor for this section
- Practice questions