Recognizing Handwritten Digits

Mohit Giri
3 min readDec 19, 2020

--

Hello , Everyone. In this blog we are going to recognizing the handwritten digits (0 to 9) from the given dataset through machine learning .

We are analyzing Recognizing Handwritten Digits with scikit-learn.”Scikit-learn is useful library for machine learning in Python. The sklearn library contains a lot of efficient tools for machine learning and statistical modeling including classification, regression, clustering and dimensionality reduction.”

Handwriting Recognition

Recognizing handwritten text is a problem that can be traced back to the first automatic machines that needed to recognize individual characters in handwritten documents. Think about, for example, the ZIP codes on letters at the post office and the automation needed to recognize these five digits. Perfect recognition of these codes is necessary in order to sort mail automatically and efficiently. Included among the other applications that may come to mind is OCR (Optical Character Recognition) software. OCR software must read handwritten text, or pages of printed books, for general electronic documents in which each character is well defined.

But the problem of handwriting recognition goes farther back in time, more precisely to the early 20th Century (1920s), when Emanuel Goldberg (1881–1970) began his studies regarding this issue and suggested that a statistical approach would be an optimal choice.

To address this issue in Python, the scikit-learn library provides a good example to better understand this technique, the issues involved, and the possibility of making predictions.

Let us start by importing our libraries and data-set.

data-set is stored in digits

The images of the handwritten digits are contained in a digits.images array. Each element of this array is an image that is represented by an 8x8 matrix of numerical values that correspond to a grayscale from white, with a value of 0, to black, with the value 15.

Our data-set is stored in digits. By the command given below, you will obtain a grayscale image of digit.

we trained the data-set and we use the last six as a validation set.

output:

we are training the svc estimator that we have defined above.

Now we have to test our estimator, making it interpret the six digits of the validation set.

It is able to recognize the handwritten digits, interpreting correctly all six digits of the validation set.

Lets train and test the dataset and find the predicting accuracy.

we give 25 percent data-set to test and remaining data-set to train.

we give 25 percent data-set to test and remaining data-set to train.

we predicting ,measuring performance of our model and the score is 95%.

--

--

No responses yet