Learn ML Algorithms from Scratch
The building blocks of machine learning written in plain NumPy, so each one can be read and tested on its own.
- Status
- Status: CompletedFinished and delivered. It does what it set out to do and no more work is planned.
- Kind
- Machine Learning
- Started
- Jun 2025
- Updated
- Nov 2026
About it
The problem
Libraries make it easy to train a model without seeing what an optimizer, a loss or an activation actually computes. That leaves beginners unsure which piece to change when a model does not learn.
The approach
I wrote each component in NumPy alone, as small modules with one job each. Linear regression is built from them end to end, with worked examples.
- Gradient descent, Momentum, RMSProp and Adam optimizers.
- MSE, MAE, Huber and cross-entropy losses, and sigmoid, ReLU, tanh and softmax activations.
- Accuracy, precision, recall, F1 and R² metrics, with scalers, encoders and a train/test splitter.
The result
An open-source study project with a test suite for every module, which pairs with Neural Network from Scratch and LSTM Gold from Scratch.
What it does4
Optimizers
Losses and Activations
Metrics and Preprocessing
Tested
More work

Rone Arena API
A public FastAPI for Mobile Legends hero data, analytics and player tools, with a web playground and SDKs.

BeliMadu.com
An online honey shop on Next.js 16 and Cloudflare Workers, with a WhatsApp-checkout cart and a Vitest suite.

ridwaanhall.com
This site: a portfolio and blog on Next.js 16 with an admin, Markdown versions of every page and a CV generated from the About page.
Comments0
Signed-in readers can comment.