100 beginner machine learning projects with runnable Python code, tests and honest case studies. By Networkers Home, Bangalore.
This small teaching project demonstrates supervised neural classification on handwritten digit images using a compact dense (fully connected) neural network. It trains a multilayer perceptron on a small, built-in digit dataset, holds out validation and test splits, reports per-digit accuracy on the held-out test set, and provides a simple textual inspection of misclassified examples with confidence scores. The goal is to practice tensor/array shapes, loss-driven training, held-out evaluation and cautious interpretation of results.
This project uses the scikit-learn built-in digits dataset (load_digits). That dataset contains 8×8 grayscale digit images and is used here as a small stand-in for MNIST (28×28) so students can run experiments quickly without downloading external data. The README is honest about this: the data is built-in and smaller than canonical MNIST.
Run the project file with Python 3.11+. For example:
python project.py
This prints a JSON object with metrics and will run deterministically when you pass the same seed.
Use pytest to run the bundled tests:
pytest -q
The tests check that the run function returns the expected keys, that metrics are in valid ranges, that a conservative accuracy floor is met on the held-out test set, and that runs with the same seed are deterministic.
Measured by running python project.py (seed 42) on 2026-10-23; the tests in test_project.py assert the floor.
| Metric | Value |
|---|---|
| test_accuracy | 0.9750 |
| n_train | 1257 |
| n_val | 180 |
| n_test | 360 |
Also returned (see python project.py output): per_class_accuracy (object), model_hidden_layers (1 items), misclassified_examples (6 items).
This project uses the smaller scikit-learn digits dataset as a faithful but downscaled stand-in for MNIST. The model is a densely connected classifier (MLPClassifier) rather than a convolutional neural network, so it does not capture spatial inductive biases that are useful for full-sized MNIST or real OCR tasks. No external data is downloaded, and no claims are made about real-world OCR performance.
Suggested next steps for students:
Full case study, build steps and evaluation checks: Neural network for MNIST digit recognition on networkershome.com
Built by Networkers Home · Learn the skills in the AI Engineer Course · Part of 100 AI projects with code