A simple implementation of KNN binary classification in numpy, python 3. The file knn.py contains the class defining the K-nearest neighbors model. The notebook main.ipynb test the model by using the iris dataset.
Recall that the k-nn is a non-parametric classification model. The idea is, given a data point x, find the k closest points x and then label x to the class containing the majority of these k datapoints.