Skip to content

This repository contains a Jupyter Notebook (`DigitClassifier.ipynb`) that demonstrates the use of the Naive Bayes classifier for recognizing handwritten digits. It uses the UCI Optical Recognition of Handwritten Digits dataset, which consists of 8x8 images of handwritten digits.

License

Notifications You must be signed in to change notification settings

Shubham722-227/Digit_Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Handwritten Digit Recognition with Naive Bayes

This repository contains a Jupyter Notebook (DigitClassifier.ipynb) that demonstrates the use of the Naive Bayes classifier for recognizing handwritten digits. It uses the UCI Optical Recognition of Handwritten Digits dataset, which consists of 8x8 images of handwritten digits.

  • Problem

Problem Picture

Table of Contents

Introduction

The Jupyter Notebook (DigitClassifier.ipynb) in this repository demonstrates the following:

  1. Importing necessary Python libraries, including NumPy, Pandas, Matplotlib, and scikit-learn.
  2. Importing the Multinomial Naive Bayes classifier from scikit-learn.
  3. Loading the UCI Optical Recognition of Handwritten Digits dataset.
  4. Splitting the dataset into training and testing sets with a 50% split size.
  5. Training a Naive Bayes model on the training data.
  6. Making predictions on the test data and calculating the accuracy score.
  7. Visualizing the results by showing the predicted labels for random 20 images.
  8. Building a probability table for all single-digit numbers.

Getting Started

To run the Jupyter Notebook on your local machine, follow these steps:

  1. Clone this repository to your local machine:
git clone https://github.com/Shubham722-227/Digit_Classifier.git
  1. Navigate to the project directory:
cd Digit_Classifier
  1. Install Jupyter Notebook (if you haven't already):
pip install jupyter
  1. Start Jupyter Notebook:
jupyter notebook
  1. Open the Jupyter Notebook (DigitClassifier.ipynb) in your browser.

  2. Run the notebook cell by cell to execute the code.

Usage

The Jupyter Notebook can be used as a starting point for handwritten digit recognition tasks using Naive Bayes classifiers. You can modify the dataset, use different classifiers, or further customize the code to fit your specific requirements

Screenshots

  • Accuracy

Accuracy

Results

The Jupyter Notebook provides the following results:

  • Naive Bayes score: The accuracy score of the Naive Bayes model on the test data.
  • Counts of each number in the random split.
  • Predictions on 20 random images.
  • Probability table for all single-digit numbers. You can analyze these results to understand the performance of the model.

if you like what i do, maybe consider buying me a coffee/tea 🥺👉👈

Buy Me A Coffee

Authors

License

MIT License

About

This repository contains a Jupyter Notebook (`DigitClassifier.ipynb`) that demonstrates the use of the Naive Bayes classifier for recognizing handwritten digits. It uses the UCI Optical Recognition of Handwritten Digits dataset, which consists of 8x8 images of handwritten digits.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published