Classifier--Kth Nearest Neighbors
(Note : The code pertaining this page is "knn_neighbors.py" on our submitted github)
We used the same Euclidean space as it was in Nearest Centroid model, and assumed K to be 11 so that K wouldn't be easily equally divided by the four classes. We can compare this model to creating a globe which enclosed K "voters", and picking one class that obtained the most "votes".
We used the same Euclidean space as it was in Nearest Centroid model, and assumed K to be 11 so that K wouldn't be easily equally divided by the four classes. We can compare this model to creating a globe which enclosed K "voters", and picking one class that obtained the most "votes".
Practice
Like Nearest Centroid, KNN python model also requires three arguments (air quality, temperature, dust concentration), and in KNN, users can get a confidence percentage in addition to the output class that the input testing point was assigned to.