-
Take input from “train.txt” and plot the points with different colored markers according to the assigned class label.
-
Implement KNN algorithm. The value of K will be taken from user. Classify the test points from “test.txt” with different colored markers according to the predicted class label.
-
Print the top K distances along with their class labels and the predicted class to “prediction.txt” for each of the test data.
nawrin14 / k-nearest-neighbors Goto Github PK
View Code? Open in Web Editor NEWImplementation of K-Nearest Neighbors (KNN) in Python