amitshekhariitbhu/build-your-own-x-machine-learning

Build your own X - Master machine learning by building everything from scratch. It aims to cover everything from linear regression to deep learning to large language models (LLMs).

Build‑your‑own‑X – Machine Learning

What it is – A curated set of pure‑Python (mostly NumPy‑based) tutorials that re‑implement classic machine‑learning and deep‑learning techniques from first principles. The repo is organized like a textbook: each algorithm or application lives in its own folder under tutorials/ and contains a single .py file that you can run to see the model built and trained without any external ML libraries.

Why it matters – Writing these algorithms yourself is a proven way to understand the math and engineering behind them. The collection covers the whole pipeline:

  • Core algorithms – linear/logistic regression, K‑NN, SVM, decision trees, random forests, gradient boosting, PCA, clustering (K‑means, DBSCAN, hierarchical, spectral, etc.), and many loss functions/optimizers.
  • Deep learning – from a hand‑rolled neural‑network implementation to CNNs, LSTMs, Transformers, GANs, diffusion models, and even mini‑frameworks that mimic TensorFlow/PyTorch using only NumPy.
  • Applied projects – recommendation engines, computer‑vision apps (OCR, traffic‑sign classifier, face‑mask detection, etc.), NLP utilities, time‑series forecasting, anomaly detection, and more.

Who it’s for – Anyone who wants to move beyond “black‑box” usage of libraries like scikit‑learn or PyTorch and actually see how the algorithms work under the hood. It’s useful for students, hobbyists, or interview preparation where a deep conceptual grasp is required.

How to use it – Clone the repo, navigate to the desired tutorial folder, and run the provided Python script. Most scripts are self‑contained and include synthetic data generation, model training, and a simple evaluation/visualisation step. Because the code relies only on the Python standard library and NumPy, there are no heavyweight dependencies.

What’s next – The author notes that new tutorials will be added over time, so the collection is intended to grow alongside emerging topics (e.g., larger LLM implementations, newer diffusion techniques, etc.).


TL;DR – A hands‑on, from‑scratch implementation library for a very wide range of machine‑learning and deep‑learning methods, aimed at teaching the fundamentals through runnable Python code.