Skip to content

abhigyan02/digits-recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Digits-Recognition

This repository contains a Python code that demonstrates digit classification using Support Vector Machines (SVM). The code utilizes the Digits dataset from the scikit-learn library and includes functionality for training an SVM classifier, evaluating its performance, and making predictions on test images.

Dataset

The Digits dataset consists of a collection of 8x8 images of handwritten digits (0-9). Each image is represented as a matrix of grayscale pixel values. The dataset is included in the scikit-learn library and can be loaded using the datasets.load_digits() function.

This will execute the SVM digit classification script, which performs the following steps:

  • Loads the Digits dataset.
  • Flattens the 8x8 images into a one-dimensional array.
  • Splits the dataset into training and testing sets (75% training, 25% testing).
  • Trains an SVM classifier using the training data.
  • Predicts the labels for the testing data.
  • Generates a confusion matrix to evaluate the classifier's performance.
  • Displays the confusion matrix plot.
  • Prints the accuracy score of the classifier.
  • Displays the prediction for a test image.

Examine the results:

  • The confusion matrix plot provides a visual representation of the classifier's performance, showing the number of correctly and incorrectly classified instances for each digit.

  • The accuracy score indicates the percentage of correctly classified instances in the testing set.

  • image

  • image

Example Output

Here is an example of the output generated by the code:

image

image

Releases

No releases published

Packages

No packages published

Languages