Lesson 1 · Unit 04
Clustering
k-means by hand: assign, move, repeat
What you practise
- K-means by hand (assign, move, repeat), inertia and the elbow, why the start matters, shapes k-means cannot find
Try a question from this lesson
Pick one
Six customers by number of orders: 1, 2, 3, 10, 11, 12. Nobody labelled them. You must sum them up as two "typical customers". Which two values lose the least detail?
Hint
Group the values that sit close together, then pick the middle of each group.
Correct answer
2 and 11
Why
The values fall into two clumps, and the middle of each (2 and 11) is at most 1 away from every member. That is clustering: find groups without labels, and sum each one up by its centre.
The idea
Concept cards are short on purpose. In the app they appear between questions, after you have met the idea.
Concept
k-means
k-means finds k cluster centres by repeating two steps.
Assign: give every point to its nearest centre. Update: move every centre to the mean of the points it was given.
Repeat until the assignments stop changing. Neither step can raise the total squared distance from points to their centres, so the loop always settles.
10 more exercises in the app
- 3× type the answer
- 1× order the lines
- 1× fill the blanks
- 3× multiple choice
- 2× true or false
Bitpath is an iOS app in development. Join the waitlist and you get one email when it is ready to try.