k-NN starts from labeled points in a coordinate plane. This lesson only fixes the exact training set so later distance calculations have a visible source.

highlighted = computed this step

Class labels live on points

The training set is a collection of exact integer points with class labels. For example, (0, 0) has class A and (3, 3) has class B.

training point (0,0)A\text{training point }(0, 0)\mapsto A
Training pointsOnly the labeled training set is shown.Training pointsTraining pointsExact labeled training points.0:A1:A2:A3:B4:B5:B

Why neighbors matter

The mechanism compares a query point to these labeled points. Nearby labels supply the vote once a query is displayed.

labels sit on exact coordinates\text{labels sit on exact coordinates}
Training pointsOnly the labeled training set is shown.Training pointsTraining pointsExact labeled training points.0:A1:A2:A3:B4:B5:B

Summary

No query point has been classified yet. This step only fixes the displayed training positions that later arithmetic must reuse.

training set fixed\text{training set fixed}
Training pointsOnly the labeled training set is shown.Training pointsTraining pointsExact labeled training points.0:A1:A2:A3:B4:B5:B