Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Classification Project

Initial project documentation for the EDK classification assignment.

Status

  • MNIST: implemented for Part 1 and Part 2.
  • Iris: under construction.

Project Structure

Key folders/files:

  • mnist/: MNIST implementation scripts and tests.
  • data/mnist/: MNIST dataset files (.gz).
  • utils.py: shared confusion-matrix and error-rate helpers.
  • report/figures/: report-ready saved figures.

Environment

Recommended Python version: 3.10+.

Required packages:

  • numpy
  • scipy
  • matplotlib
  • scikit-learn (required for Part 2 k-means)

Install example:

pip install numpy scipy matplotlib scikit-learn

MNIST

Dataset Placement

Place the following files under data/mnist/:

  • train-images-idx3-ubyte.gz
  • train-labels-idx1-ubyte.gz
  • t10k-images-idx3-ubyte.gz
  • t10k-labels-idx1-ubyte.gz

Expected layout:

classification_project/
	data/
		mnist/
			train-images-idx3-ubyte.gz
			train-labels-idx1-ubyte.gz
			t10k-images-idx3-ubyte.gz
			t10k-labels-idx1-ubyte.gz

Part 1: NN with Full Training Templates

Script: mnist/part1_nn.py

Run from mnist/:

python part1_nn.py --lite
python part1_nn.py --full
python part1_nn.py --full --quiet

Flags:

  • --lite: quick synthetic smoke run (no file outputs).
  • --full: full MNIST run (default behavior if no mode flag is provided).
  • --quiet: suppress metric/confusion-matrix printing.

Notes:

  • Full mode creates confusion matrices and image grids under mnist/results/ and report/figures/.
  • If plot windows block terminal completion, use:
MPLBACKEND=Agg python part1_nn.py --full

Part 2: K-Means Templates + NN/KNN

Script: mnist/part2_kmeans.py

Run from mnist/:

python part2_kmeans.py --lite
python part2_kmeans.py --full --clusters 64 --k 7
python part2_kmeans.py --full --clusters 64 --k 7 --quiet

Flags:

  • --lite: quick synthetic smoke run (no file outputs).
  • --full: full MNIST run (default behavior if no mode flag is provided).
  • --quiet: suppress metric/confusion-matrix printing.
  • --clusters: templates per class for k-means (default: 64).
  • --k: KNN neighbor count for Part 2c (default: 7).

Smoke Tests

Run from mnist/:

python tests/test_part1.py
python tests/test_part2.py

What these tests do:

  • Validate core logic on small synthetic data.
  • Verify chunked processing and output shape constraints.
  • Confirm assignment-specific behavior (Euclidean distance, template usage, and pipeline side-effect controls).
  • Avoid heavy full-dataset runtime.

Output Files

Generated outputs are saved under:

  • mnist/results/confusion_matrices/
  • mnist/results/misclassified_images/
  • report/figures/

Iris

Iris section is intentionally minimal for now and will be expanded once the implementation is complete.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages