Skip to content
This repository was archived by the owner on May 16, 2026. It is now read-only.

Abosmra/Machine-Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

CSE382 — Machine Learning Project

MNIST classification implemented from scratch with three classifiers: Naïve Bayes, Decision Tree, and Linear SVM. Only numpy, matplotlib, seaborn, and sklearn.datasets.fetch_openml (for loading data) are used — every model is built by hand.

Project Structure

File Description
phase1_binary_classification.ipynb Phase 1 — Binary Classification. Loops over each digit d = 0..9 and trains a one-vs-rest classifier (digit d vs all others) using all three models.
phase2_multiclass_classification.ipynb Phase 2 — Multi-Class Classification. True 10-class classification on digits 0–9. Naïve Bayes uses one Gaussian per class, Decision Tree uses weighted multi-class Gini, Linear SVM uses 10 one-vs-rest binary classifiers.

Models

Model Phase 1 (Binary) Phase 2 (Multiclass)
Naïve Bayes Gaussian likelihood, log-odds threshold One Gaussian per class, argmax log-likelihood
Decision Tree Weighted Gini, max_depth=12 Multi-class weighted Gini, leaf returns class 0–9
Linear SVM Hinge loss with class weights 10 one-vs-rest binary SVMs

Dataset

MNIST (mnist_784, 70,000 × 784) loaded via sklearn.datasets.fetch_openml. Stratified train / validation / test split, normalised to [0, 1], and standardised for the SVM.

Running

pip install numpy matplotlib seaborn scikit-learn
jupyter notebook

Open either notebook and run all cells.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors