Machine Learning

ML-DL-py

Hands-on Machine Learning notebooks in Python — each example is a self-contained uv project with its own environment and README.

Description

Practical walkthroughs of classical ML workflows: load data, train a model, evaluate, and experiment. Topics include text classification, face detection, generative modeling, and digit recognition.

Project layout

Each example lives in its own root-level folder. Folder names follow algorithm + task (e.g. naive-bayes-text-classification, hog-svm-face-detection).

Every project is a uv environment: cd into the folder and run uv sync, then open the notebook with that project’s kernel.

Hugging Face env (.env)

Copy .env.example to .env at the repo root and set:

  • HF_HOME — shared model cache (default ~/ml-models)
  • HF_TOKEN — optional Hugging Face token for higher rate limits

Notebooks / CLIs in hf-text-to-speech, mflux-text-to-image, and rembg-background-removal load this file via python-dotenv. .env is gitignored.

Projects

NameDescription
naive-bayes-text-classificationMultinomial Naive Bayes text classification on 20 Newsgroups
hog-svm-face-detectionHOG features + linear SVM face detector
gmm-handwritten-digit-generationPCA + GMM to synthesize handwritten digits
isomap-gaussian-nb-digit-classificationIsomap embedding + GaussianNB digit classification
hf-text-to-speechLocal TTS with hexgrad/Kokoro-82M from Hugging Face
mflux-text-to-imageFLUX.1-schnell via mflux/MLX (4-bit; not HF diffusers)
rembg-background-removalBatch background removal with danielgatis/rembg