A binary classification problem

Assign a label to the purple star point

Step 1: find the 3 nearest neighbors

Step 2: preditc it as the color of majority

Another example

Step 1: find the 3 nearest neighbors

Step 2: preditc it as the color of majority

If apply KNN to all possible points, then…

We get the decision Boundary

© 2024 Xijia Liu. All rights reserved. Contact: xijia.liu AT umu.se
Logo