Syed Yousuf Zaidi
3 min readJul 4, 2021

--

Recognizing Handwritten Digits with Scikit-learn :

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.

Objective of the project : To predict the hand-written digits using one of the Machine Learning Algorithm i.e. SVM (Support Vector Machine).

Language used : Python 3
IDE : Jupyter Notebook
Libraries used : Numpy, Pandas, Matplotlib, Seaborn, Sklearn

Support Vector Machine or SVM is one of the most popular Supervised Learning algorithms, which is used for Classification as well as Regression problems. However, primarily, it is used for Classification problems in Machine Learning.

The goal of the SVM algorithm is to create the best line or decision boundary that can segregate n-dimensional space into classes so that we can easily put the new data point in the correct category in the future. This best decision boundary is called a hyperplane.

SVM chooses the extreme points/vectors that help in creating the hyperplane. These extreme cases are called as support vectors, and hence algorithm is termed as Support Vector Machine. Consider the below diagram in which there are two different categories that are classified using a decision boundary or hyperplane:

Let’s Start :

Step 1: Importing the required libraries.

Necessary Libraries to be used

Step 2: Loading the data set.

Step 3: Exploring the Digits dataset.

Step 4: Data Visualisation of the dataset.

Step 5: Train & test the dataset using SVM Classifier.

Step 6: Comparing the Predicted VS Actual reading :

Step 7: Now at last, Checking the Score :

A Confusion matrix is an N x N matrix used for evaluating ’n’ the performance of a classification model, where N is the number of target classes.

The matrix compares the actual target values with those predicted by the Machine learning model.

Confusion Matrix

Conclusion: As from above, we can say that the accuracy of Support Vector Machine is 98.60% and the Mean Squared Error is 0.47.

“I am thankful to mentors at https://internship.suvenconsultants.com for providing awesome problem statements and giving many of us a Coding Internship Exprience. Thank you www.suvenconsultants.com"

--

--

Syed Yousuf Zaidi
0 Followers

Aspiring good human being & a writer too.