To me, K Nearest Neighbors (KNN) is very intuitive. Take classification tasks as an example. What KNN does is to find K training examples that are “closest” to the test example. These K training examples have K labels. We find the most common label, and it is the predicted label for the test example in question.
How to quantify “closest”? Two simple methods are Euclidean distance or Manhattan distance.
I’ll take the MNIST dataset as an …