k-nearest neighbors (KNN)
2 min readNov 12, 2022
One of several (supervised learning) classifier algorithms used in data mining and machine learning is K-Nearest Neighbors, commonly known as KNN. It is a classifier method where the learning is based on “how similar” is a data (a vector) from other.
How does K-NN work?
Suppose we have:
- a dataset A,
- a defined distance metric…