Training a kNN classifier is easy. First, you need to load in the training data, which will be used for every classification. After we do this, we receive a new data point that we want to classify, as shown in the following diagram:
We compute the distance of the data point from each point in the training set, as shown in the following diagram:
Then, we determine the k nearest points, as shown in the following diagram:
In this diagram, we can see that k is 3.
The most common class among those nearest points is the ...