internalsGet Pro

Module 03 · Lesson 12 of 12Pro

PCA: keeping the directions that matter

Level
Intermediate
Topic
Linear algebra for machine learning
Reading time
17 min

When you finish this page you can

  1. Turn a table of overlapping features into a few uncorrelated directions by centring, scaling and finding the covariance matrix’s eigenvectors.
  2. Read explained variance to see how much of the data each direction keeps, and choose how many to keep with a validation score.
  3. Fit scikit-learn’s PCA on training rows only, inside a pipeline, and reuse that one fit everywhere.
  4. Spot when PCA throws away the signal a model needed, because it never looks at the label.

Builds on 3 lessons

Start with lesson 716 min
  1. Rank: spotting redundant features16 min
  2. Eigenvectors: the natural axes of a matrix16 min
  3. SVD: breaking a matrix into simple parts18 min

Forty-eight columns that rise and fall together

is our example online store. Its ML team predicts which customers will stop buying, so Joseph’s growth team can send them a voucher. Farah, an ML engineer, works on a notebook sample of 200,000 customers.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan