LESSON 4.18 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW
K-nearest neighbors
Watch the K nearest known fruits vote on the label of a new fruit.
Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.
Go Pro · $8.25/moEXPLAINER · 4.18 · NEIGHBOR BAY16 FRUITS · 9 APPLES · 7 PEARS
01
Stage 1 of 6 · Known fruits
Training KNN only stores the 16 known fruits. The new fruit q has no label yet.
Explain it simply
Each mark is a fruit you already know. Its spot shows its width and height. Its shape shows its label: a circle for an apple, a triangle for a pear. One pear is odd: it's wide and short, so it sits with the apples. KNN learns nothing ahead of time. It keeps the list and waits.
16 known fruits on a plane of width and height in cm: 9 apples and 7 pears. The new fruit q is at (7.5, 9.1).
known fruit (circle apple, triangle pear), new fruit qK, its circle, vote weightvote and predictionleave-one-out misstraining error
Toy: 16 known fruits (9 apples, 7 pears) · 2 features in cm · 1 new fruit · a 28 × 28 grid
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
The data is 16 fruits, each a point with a label.
PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
- 5 more stages and 3 live controls
- 2 mix-up cards and 3 predict-then-reveal checks
- Watch it as a narrated video, in three voices
- Every Pro lesson and capstone · 656 in total
$99 a year, or $15 a month. Cancel any time.