rAs Kids All courses
AI: Build & Break It ยท Module 2 of 8
๐Ÿชจ No device needed

Be the Classifier

Classifying is drawing a line through your data and deciding which side new things fall on.

๐ŸŸข๐ŸŸข โ•ฑ ๐Ÿ”ด๐Ÿ”ด โ“
A chalk grid on the ground with two clusters of stones separated by a straight chalk line, and one unknown stone sitting near it.

๐ŸŽ’ What you need

โœ‹ Do this

  1. Redraw your two axes big, on the ground. Place a stone for every good grain and a cap for every damaged one, at its measured position.
  2. Lay your stick down as a straight line that best separates stones from caps. Move it until you cannot do better.
  3. Count the mistakes: stones on the wrong side, caps on the wrong side. Write that number down. A perfect split is rare and slightly suspicious.
  4. Take a NEW grain, measure it, place it. Which side of the stick? That is your prediction. Now check the real answer.
  5. Second method: for that same new grain, find its three nearest neighbours on the ground and take a vote. Did the two methods agree?
  6. Now curve your line using string instead of a stick. Can you get zero mistakes? And do you trust a line that twists around every single dot?

๐Ÿ’ก Why it works

You have just built two real classifiers by hand. The straight stick is a linear classifier; the vote of nearest points is k-nearest-neighbours, still used in production today. And the twisting string is overfitting: a boundary so contorted to fit your exact examples that it will do badly on the next grain it meets. That tension between fitting your data and generalising to new data is the central problem in machine learning.

๐Ÿ”ฅ Challenge

Split your data in half. Fit your line using only the first half, then test it on the second half you never looked at. Report both error counts. That gap is what the field really cares about.

๐Ÿ“– New words

classifiera system that assigns a new example to one of several classes
decision boundarythe line or surface separating one class's region from another's
overfittingmatching your training examples so exactly that you fail on new ones
๐Ÿ“
Boundary Drawer

Tap when you have finished this module.