Skip to content

BlodgettDavid/ml-edu-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ML‑Edu‑Lab

ML‑Edu‑Lab is a cross‑framework machine learning education environment designed to teach end‑to‑end ML workflows using scikit‑learn, PyTorch, and TensorFlow. The project emphasizes reproducibility, clarity, and architectural consistency, making it ideal for students, educators, and anyone exploring how different ML frameworks approach the same problems.

The system provides a unified pipeline for:

  • Loading and exploring datasets
  • Training models across multiple frameworks
  • Saving timestamped artifacts (models, plots, logs)
  • Evaluating results
  • Running inference
  • Visualizing data and model behavior through a Streamlit GUI

All training scripts follow a consistent architecture and write outputs into the artifacts/ directory.


📁 Project Structure

ml-edu-lab/
│
├── artifacts/                # Auto-generated models, plots, logs
│   ├── models/
│   ├── plots/
│   └── logs/
│
├── src/
│   ├── algorithms/           # Training demos (sklearn, PyTorch, TensorFlow)
│   ├── data_loaders/         # Iris, MNIST, IMDB loaders
│   ├── utils/                # Logging, timestamping, paths, inference helpers
│   ├── visualize/            # Streamlit GUI components
│   └── main.py               # CLI and GUI launcher
│
├── run_tests.py              # Cross-framework interactive test runner
├── requirements.txt          # Minimal reproducible environment
└── README.md                 # Project documentation

🚀 Running Training Scripts

All frameworks share a unified command‑line interface.

Scikit‑learn

python -m src.algorithms.sklearn_demo --dataset iris
python -m src.algorithms.sklearn_demo --dataset mnist
python -m src.algorithms.sklearn_demo --dataset imdb

PyTorch

python -m src.algorithms.pytorch_demo --dataset iris --epochs 5 --batch_size 32 --depth 2
python -m src.algorithms.pytorch_demo --dataset mnist --epochs 5 --batch_size 128 --depth 2
python -m src.algorithms.pytorch_demo --dataset imdb --epochs 5 --batch_size 128 --depth 2

TensorFlow

python -m src.algorithms.tensorflow_demo --dataset iris --epochs 5 --batch_size 32 --depth 2
python -m src.algorithms.tensorflow_demo --dataset mnist --epochs 5 --batch_size 128 --depth 2
python -m src.algorithms.tensorflow_demo --dataset imdb --epochs 5 --batch_size 128 --depth 2

📦 Artifact Architecture

Each training run produces a complete set of reproducible artifacts:

  • models/ — saved model files
  • plots/ — confusion matrices and training curves
  • logs/ — append‑only experiment log

All artifacts are timestamped for easy comparison across runs.


🧪 Cross‑Framework Test Runner

python run_tests.py

This script runs scikit‑learn, PyTorch, and TensorFlow demos end‑to‑end and confirms that the environment is correctly configured.


🖥️ Streamlit GUI

Launch the GUI with:

python src/main.py

The interface includes:

  • Data Exploration
  • Train Model
  • Evaluate Model
  • Inference

🔧 Installation

python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -r requirements.txt

📊 Dataset Overview

Iris

  • Tabular
  • 3 classes
  • Not binary

MNIST

  • Image classification
  • 10 classes
  • Not binary

IMDB

  • Text sentiment
  • 2 classes
  • Binary

These datasets illustrate how different frameworks handle tabular, image, and text data — and why model capacity matters.


🎯 Goals of the Project

  • Teach ML workflows end‑to‑end
  • Compare frameworks in a consistent environment
  • Provide a reproducible, educational ML sandbox
  • Help learners build intuition through experimentation
  • Demonstrate clean engineering practices and artifact management

📄 License

MIT License.

About

A unified ML education lab for teaching end‑to‑end workflows across scikit‑learn, PyTorch, and TensorFlow.

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages