awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
trekhleb avatar

trekhleb/homemade-machine-learning

0
View on GitHub↗
24,608 stars·4,186 forks·Jupyter Notebook·MIT·28 views

Homemade Machine Learning

This project provides a collection of machine learning algorithms implemented from scratch in Python. It serves as an educational resource using interactive notebooks that combine code with mathematical explanations to demonstrate the first principles of data science.

The repository includes reference implementations for neural networks, such as multilayer perceptrons with backpropagation, and supervised learning models including linear and logistic regression. It also covers unsupervised learning through k-means clustering and Gaussian anomaly detection.

The codebase covers a broad range of mathematical foundations, including iterative gradient descent, closed-form normal equations, L2 regularization, and polynomial feature transformations. Supporting utilities are provided for feature scale normalization, performance metric calculation, and sample dataset provisioning.

Features

  • Multilayer Perceptrons - Provides a from-scratch implementation of multilayer perceptrons with input, hidden, and output layers.
  • Machine Learning Education - Serves as an educational resource for learning the mathematical foundations of ML through scratch implementations.
  • Backpropagation - Implements the backpropagation algorithm to calculate gradients and update neural network weights.
  • Classification - Implements multi-class classification using a one-vs-all approach to categorize inputs.
  • K-Means Clustering - Provides a manual implementation of k-means clustering for unsupervised data partitioning.
  • Logistic Regression Models - Implements logistic regression for binary classification by fitting data to a logistic curve.
  • Machine Learning Implementations - Provides code-based reference implementations of core machine learning algorithms written from first principles in Python.
  • Linear Regression Implementations - Provides an educational from-scratch implementation of linear regression using gradient descent.
  • Gradient Optimization Techniques - Applies gradient optimization and regularization techniques to improve model convergence and accuracy.
  • Forward Propagation Engines - Provides the computational logic for the forward pass in multilayer perceptrons.
  • Neural Network Implementations - Builds multilayer perceptrons from scratch, focusing on the low-level mechanics of neural networks.
  • Gradient Descent Algorithms - Implements gradient descent as the primary iterative optimization method for minimizing cost functions.
  • Supervised Learning - Implements supervised learning workflows including linear and logistic regression for prediction and classification.
  • Unsupervised Learning - Implements unsupervised learning workflows for clustering and anomaly detection in unlabeled data.
  • Backpropagation Training - Implements the backpropagation algorithm from scratch to enable training of multilayer perceptrons.
  • Model Prediction Logic - Provides feedforward propagation to identify the most probable class labels for input data.
  • Anomaly Detection - Implements a Gaussian distribution-based system to identify outliers as low-probability observations.
  • Feature Scale Normalization - Provides mean normalization utilities to ensure stable convergence during gradient descent training.
  • Feature Expansion - Provides utilities for polynomial feature expansion to model non-linear relationships within linear regression.
  • Polynomial Feature Mapping - Enables non-linear relationship modeling by transforming independent variables into polynomial features.
  • Closed-Form Solvers - Implements a closed-form solver using the normal equation to compute optimal model parameters without iteration.
  • Performance Metrics - Provides utilities to compute F1 score, precision, and recall for model performance measurement.
  • Regularization Techniques - Implements L2 regularization to penalize large coefficients and prevent model overfitting.
  • Clustering and Density Estimation - Implements unsupervised techniques including K-Means clustering and Gaussian density estimation for outlier detection.
  • Weight Initialization - Includes utilities for initializing neural network weights to break symmetry during training.
  • L2 Regularization - Includes L2 regularization (ridge penalty) to prevent overfitting by penalizing large coefficient magnitudes.
  • Educational Notebooks - Provides interactive Jupyter notebooks that interleave Python code with mathematical explanations.
  • Supervised Learning Examples - Offers practical examples of supervised learning, including linear/logistic regression and regularization.
  • Data Science Projects - Implementations of machine learning algorithms from scratch.
  • Educational Resources - Python implementations of algorithms with interactive demos.

Star history

Star history chart for trekhleb/homemade-machine-learningStar history chart for trekhleb/homemade-machine-learning

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Projects sharing features with Homemade Machine Learning

These projects share indexed features with Homemade Machine Learning. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • lawlite19/machinelearning_pythonlawlite19 avatar

    lawlite19/MachineLearning_Python

    8,526View on GitHub↗

    This is a Python machine learning library featuring a collection of core algorithms implemented from scratch to demonstrate foundational AI concepts. It provides a comprehensive toolkit for supervised learning, unsupervised learning, and neural network development. The project is distinguished by its custom implementation of a neural network framework, which includes multi-layer perceptrons with backpropagation, gradient descent, and weight regularization. It also includes a specialized anomaly detection toolkit that identifies outliers and rare events using Gaussian probability distributions

    Python
    View on GitHub↗8,526
  • d2l-ai/d2l-end2l-ai avatar

    d2l-ai/d2l-en

    29,001View on GitHub↗

    This project is an educational platform and research toolkit designed to teach deep learning through a combination of mathematical theory, visual diagrams, and executable code. It provides a comprehensive environment for building, training, and evaluating neural networks, grounding complex concepts in interactive computational notebooks that allow for hands-on experimentation. The framework distinguishes itself by interleaving theoretical foundations—including linear algebra, calculus, and probability—with practical implementations across multiple industry-standard libraries. It supports flex

    Pythonbookcomputer-visiondata-science
    View on GitHub↗29,001
  • greyhatguy007/machine-learning-specialization-courseragreyhatguy007 avatar

    greyhatguy007/Machine-Learning-Specialization-Coursera

    6,996View on GitHub↗

    This repository is a collection of implementation references and solved notebooks covering supervised, unsupervised, and reinforcement learning techniques. It provides practical guides for building predictive models, clustering algorithms, and autonomous agents. The project includes specific implementations for neural network architectures, such as multi-layer perceptrons for digit recognition, and recommender systems using collaborative and content-based filtering. It also features reinforcement learning systems that utilize deep Q-learning to optimize decision-making policies. The codebase

    Jupyter Notebookandrew-ngandrew-ng-machine-learningcoursera
    View on GitHub↗6,996
  • rasbt/python-machine-learning-bookrasbt avatar

    rasbt/python-machine-learning-book

    12,614View on GitHub↗

    This project is an educational resource providing practical code examples and implementations of machine learning algorithms using the Python language. It serves as a guide for constructing predictive pipelines, clustering models, and dimensionality reduction within the Scikit-Learn ecosystem. The repository includes comprehensive demonstrations for supervised and unsupervised learning, as well as detailed examples for implementing neural networks and deep architectures. It also provides practical guidance on exporting model parameters to JSON and wrapping trained models in web APIs for produ

    Jupyter Notebook
    View on GitHub↗12,614
Compare all 30 related projects→

Frequently asked questions

What does trekhleb/homemade-machine-learning do?

This project provides a collection of machine learning algorithms implemented from scratch in Python. It serves as an educational resource using interactive notebooks that combine code with mathematical explanations to demonstrate the first principles of data science.

What are the main features of trekhleb/homemade-machine-learning?

The main features of trekhleb/homemade-machine-learning are: Multilayer Perceptrons, Machine Learning Education, Backpropagation, Classification, K-Means Clustering, Logistic Regression Models, Machine Learning Implementations, Linear Regression Implementations.

Which projects share features with trekhleb/homemade-machine-learning?

Projects with overlapping indexed features include: lawlite19/machinelearning_python — This is a Python machine learning library featuring a collection of core algorithms implemented from scratch to… d2l-ai/d2l-en — This project is an educational platform and research toolkit designed to teach deep learning through a combination of… greyhatguy007/machine-learning-specialization-coursera — This repository is a collection of implementation references and solved notebooks covering supervised, unsupervised,… rasbt/python-machine-learning-book — This project is an educational resource providing practical code examples and implementations of machine learning… zotroneneis/machine_learning_basics — This project is a collection of foundational machine learning algorithms and tools implemented from scratch in Python.… hunkim/deeplearningzerotoall — DeepLearningZeroToAll is a comprehensive educational resource and implementation collection focused on deep learning…