homemade-machine-learning  by trekhleb

Python examples of popular machine learning algorithms with interactive Jupyter demos

created 6 years ago
23,610 stars

Top 1.8% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides Python implementations of popular machine learning algorithms from scratch, targeting students and practitioners seeking a deep understanding of the underlying mathematics and mechanics. It offers interactive Jupyter Notebook demos for each algorithm, allowing users to experiment with parameters and visualize results, thereby demystifying ML concepts beyond library one-liners.

How It Works

The project focuses on pedagogical implementation, building algorithms like Linear Regression, Logistic Regression, K-Means, and Multilayer Perceptrons from fundamental mathematical principles. Each algorithm is accompanied by detailed theoretical explanations and code examples, emphasizing a "from scratch" approach to foster a deeper comprehension of how these models learn and predict, rather than relying on high-level library abstractions.

Quick Start & Requirements

  • Install dependencies: pip install -r requirements.txt
  • Run Jupyter Notebooks locally: jupyter notebook
  • Prerequisites: Python 3, pip.
  • Demos can be viewed online via NBViewer or launched interactively on Binder.

Highlighted Details

  • Covers supervised (Regression, Classification), unsupervised (Clustering, Anomaly Detection), and neural network algorithms.
  • Interactive Jupyter Notebook demos allow real-time parameter tuning and visualization.
  • Explanations are often based on Andrew Ng's machine learning course.
  • Includes implementations for MNIST and Fashion MNIST datasets.

Maintenance & Community

The project is authored by @trekhleb. Support options via GitHub and Patreon are available.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README text.

Limitations & Caveats

Implementations are explicitly stated as "homemade" and not intended for production use. The README does not specify Python version requirements beyond a general mention of venv.

Health Check
Last commit

8 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
232 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.