Chapter 1: Classical ML

PCA: keeping the most spread

Many data sets have columns that say almost the same thing. PCA finds a few new columns that keep most of the spread, so models get smaller and faster. Interviewers ask what a component is, how many to keep and why you centre the data first.

7 minInteractive lessonChapter 1: Classical MLLesson 20 of 21

What you will learn

  • Say what a principal component is
  • Choose the number of components from the explained-variance ratio
  • Explain why data must be centred first

Key terms

spread
how far the values sit from their middle
mean
the average of one column
centre the data
subtract each column's mean, so the middle sits at (0, 0)

Prerequisites

Take Gaussian mixtures, EM and the silhouette first. It comes right before this lesson in the course.

Where this lesson picks up: In the clustering lesson, you grouped customers by how close their rows sit. That left a question: can we shrink the columns, so each row needs fewer numbers?

What comes next

One last label problem waits: what do you do with a customer who has not cancelled yet?

Next lesson: Capstone: churn with survival analysis

More lessons in this part

Take the lesson

Short cards, one idea at a time, with quick checks as you go.