Introduction to K-Nearest Neighbors
This lesson will introduce the k-nearest neighbors technique and the steps involved in its implementation.
We'll cover the following...
Quick overview
Our next supervised learning classification technique is K-Nearest Neighbors (k-NN), which classifies new unknown data points based on their proximity to known data points. This classification process is determined by setting the k
number of data points closest to the target data point. For example, if you set k
to 3, k-NN analyzes the nearest three data points (neighbors) to the target data point.
Example
Given the following dataset and predict the class for p ( and ) and value of .
Sr. | P1 | P2 | Class |
i | 7 | 7 | B |
ii | 7 | 4 | B |
iii | 3 | 4 | A |
iv | 1 | 4 | A |
- Euclidean distance
...