A tutorial for MNIST – Digit Recognition Using scikit learn


This is again a note to myself. This code has been prepared following different tutorials and SO answers. I have tried to cover many of them in reference below. The notebook is commented to the best of my ability. Starting with 11% in first trial, the final model is able to achieve accuracy of 95%.

If you are new, you might want to read this first:

Introduction To Machine Learning

A tutorial To Find Best Scikit classifiers For Sentiment Analysis


  1. Import the data in a dataframe
  2. Make data series of pixel data and the label
  3. Split the data in test and train samples
  4. Use simple SVC without any tuning. (Got 11% accuracy)
  5. Modify the data. Take out the gradient of 0-255 and replace it with simple binary 0 and 1
  6. Again use SVC (Got 90% accuracy)
  7. Use GridSearchCV to find better value of parameters
  8. Again use SCV with the optimum value of parameters (Got 95% accuracy)



Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.





If you liked this article and would like one such blog to land in your inbox every week, consider subscribing to our newsletter: https://skillcaptain.substack.com

One thought on “A tutorial for MNIST – Digit Recognition Using scikit learn

Add yours

Leave a Reply

Up ↑

%d bloggers like this: