# trekhleb/homemade-machine-learning

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

Repository: https://github.com/trekhleb/homemade-machine-learning
Canonical: https://ross.abutalabs.com/products/homemade-machine-learning
Language: Jupyter Notebook
License: MIT
License Family: permissive
Topics: python, jupyter, jupyter-notebook, machine-learning, machinelearning, machine-learning-algorithms, algorithm
Last push: 2025-11-23T04:22:46+00:00

## Health v2 (maintenance only)
Score: 56/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 53, release rhythm 35, longevity 100
- inputs: {"age_days": 2862, "days_push": 283, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 24781, forks 4193 (observed 2026-08-28T04:11:37.638593+00:00)

## What it is
A collection of popular machine learning algorithms implemented from scratch in Python, with the underlying mathematics explained. Each algorithm comes with interactive Jupyter Notebook demos for experimenting with training data and visualizing results in the browser.

## Use cases
- learn how machine learning algorithms work under the hood
- understand the math behind linear regression and logistic regression
- implement k-means and neural networks from scratch
- find interactive jupyter demos of ml algorithms
- study machine learning fundamentals with code examples
- practice implementing ml algorithms without libraries

## When to choose
- you want to deeply understand the mathematics behind ML algorithms
- you prefer learning through readable, from-scratch implementations
- you want interactive notebooks to experiment with parameters and see charts
- you are studying Andrew Ng's machine learning course and want code practice

## When to avoid
- you need production-ready, optimized ML implementations
- you want a library with one-liner APIs like scikit-learn
- you need GPU-accelerated or distributed training
- you require guaranteed maintenance and up-to-date dependencies

## Facets
- artifact type: learning-resource
- maturity: maintenance
- function: machine-learning, data-visualization, math
- domain: machine-learning, education, tutorials
- platform: python
- tags: from-scratch-implementations, jupyter-notebooks, interactive-demos, supervised-learning, unsupervised-learning, neural-networks, educational, algorithms, jupyter

## Member repositories
- trekhleb/homemade-machine-learning (main) score 56

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:37.638593+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:56:09.642251+00:00, confidence not recorded.
  - readme: https://github.com/trekhleb/homemade-machine-learning (fetched 2026-08-28T04:11:37.638593+00:00, sha 0f17c4eb9c81)
- Data as of 2026-08-30T08:39:29.467469+00:00.
