2021BCS0103 ICS322 Assignment2
2021BCS0103 ICS322 Assignment2
ASSIGNMENT-2
Name-S.Vaishnavi Reddy
Roll no-2021BCS0103
The project aims to develop a system capable of recognizing handwritten digits using Support Vector
Machines (SVM), a popular machine learning algorithm. The dataset chosen for this task is the MNIST
dataset, which contains 70,000 images of handwritten digits ranging from 0 to 9. The project follows a
systematic approach divided into several key steps:
Data Collection: The first step involves acquiring the MNIST dataset, which is available in various
formats such as CSV, JSON, etc. The choice of format depends on the programming language to be used.
For instance, if Python is the chosen language, the dataset can be downloaded in CSV format.
Data Preprocessing: Once the dataset is obtained, it needs to be preprocessed. This involves
dividing the data into two sets: a training set and a testing set. The training set is utilized to train the
SVM model, while the testing set is reserved for evaluating its performance.
Model Building: With the preprocessed data in hand, the next step is to construct the SVM model
using a suitable library like scikit-learn in Python. Key decisions during this phase include selecting
appropriate hyperparameters for the SVM model, such as the kernel function and regularization
parameter.
Model Training: The SVM model is then trained using the training dataset. During training, the
model learns to distinguish between different handwritten digits based on the features present in the
data.
Model Evaluation: Following model training, its performance is evaluated using the testing
dataset. This evaluation involves calculating various metrics, including accuracy, precision, recall, and F1-
score, to assess how well the model performs in recognizing handwritten digits.
Codes for the Project
In the code snippet above the pickle file svm_model.pkl
and scaler.pkl is used and image.jpg is used to predict the
digit as shown below is the image.jpg
Below is the implementation of the above codes in
google colab with output