Skip to content

Repository files navigation

🔢 Digit Pattern Classifier

Python scikit-learn Jupyter

A simple, straightforward machine learning pipeline designed to recognize handwritten digits (0-9) from 8x8 pixel images.

This project explores traditional machine learning algorithms and compares their performance using both raw pixel data and dimensionally reduced data (PCA).

📊 The Dataset

This project uses the optical recognition of handwritten digits dataset (a copy of the UCI ML hand-written digits dataset) built into scikit-learn.

  • Classes: 10 (Digits 0 through 9)
  • Samples: 1,797 images
  • Features: 64 (8x8 grid of integer pixels)

🧠 Models Compared

The following classifiers are trained and evaluated based on Accuracy, Precision, and Recall:

  1. Random Forest Classifier
  2. Support Vector Machine (SVM) (Polynomial Kernel)
  3. Artificial Neural Network (ANN) (Multi-Layer Perceptron)
  4. K-Nearest Neighbors (KNN)

📂 Repository Structure

  • 01_baseline_classification.ipynb: Trains the four models on the normalized 64-pixel feature set.
  • 02_pca_classification.ipynb: Applies Principal Component Analysis (PCA) to reduce the feature space from 64 to 32 dimensions before training, demonstrating the trade-off between dimensionality reduction and accuracy.

🚀 How to Run

1. Clone the repository

git clone [https://github.com/yourusername/Digit-Pattern-Classifier.git](https://github.com/yourusername/Digit-Pattern-Classifier.git)
cd Digit-Pattern-Classifier

About

A machine learning pipeline comparing baseline and PCA-reduced models (SVM, ANN, KNN, Random Forest) for handwritten digit recognition using scikit-learn.

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages