Handwritten digit recognition

This model uses KNN technique to predict handwritten digits. I have implemented this model using increasing K values {2,3,5,10,20,30,40,50,60}.
The MNIST dataset used for this project was split into 6:1 train/test split. Hence the training set contains 60,000 images and the test/validation set has 10,000 images.

                .

after

The plot shows the accuracy of the KNN model for varying values of K.

To predict the digit in a given test image its distance from all 60,000 images was recorded and its nearest K neighbors are selected for consideration. Then using maximum voting strategy, the most common occurence among the K nearest neighbor was recorded and its value is assigned to the test image.