running knn on mnist dataset for digit recognition
- Jupyter Notebook
- Python 3 or higher version
- Python Libraries
i. pandas
ii. numpy
iii. matplotlib
iv. opencv (subject to Note see below)
- open this in Jupyter Notebook and run each cell (shift + Enter)
- "test" is list which has 1D array (784x1) containing test image data
- pass this test data ie. test[x] to KNN along with training and label data (which is X and Y respectively in this case)
- Now you will get the prediction
In case if you want to perform this on your own test data which I've done in this notebook, you will to need install opencv to read the image input, but let me make one thing very clear, prediction on custom input will be horrible becuase MNIST dataset is very clean data KNN is a naive algorithm which does not do much for accuracy.