trekhleb/homemade-machine-learning

🤖 Python examples of popular machine learning algorithms with interactive Jupyter demos and math being explained

56
/ 100
Established

Implements algorithms from scratch using NumPy and mathematical principles rather than high-level ML libraries, with each algorithm accompanied by detailed mathematical derivations and proofs. Includes runnable Jupyter notebooks for regression, classification, clustering, anomaly detection, and neural networks that visualize training dynamics and allow parameter experimentation directly in the browser via Binder. Structured to teach foundational concepts through code rather than serve as production-ready implementations.

24,300 stars.

No Package No Dependents
Maintenance 6 / 25
Adoption 10 / 25
Maturity 16 / 25
Community 24 / 25

How are scores calculated?

Stars

24,300

Forks

4,163

Language

Jupyter Notebook

License

MIT

Last pushed

Nov 23, 2025

Commits (30d)

0

Get this data via API

curl "https://pt-edge.onrender.com/api/v1/quality/ml-frameworks/trekhleb/homemade-machine-learning"

Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.