Introduction

Why Machine Learning?

Machine learning is the discipline of teaching computers to learn patterns from data. It powers recommendation systems, computer vision, speech recognition, language models, medical diagnosis, and scientific discovery. Understanding ML at the algorithmic level — rather than through library calls — gives you deep intuition for what is really happening under the hood.

This course implements every algorithm from scratch in pure Python, with no NumPy or scikit-learn. When you know how to derive the gradient of MSE and implement gradient descent by hand, the theory becomes concrete and the libraries make sense.

How This Course Works

Each lesson introduces one algorithm, explains the mathematics with derivations, and asks you to implement it in Python. Tests verify your implementation against exact expected outputs.

What You Will Build

  1. Supervised Learning — Linear regression, MSE loss, R², gradient descent, multivariate regression, logistic regression, sigmoid, binary cross-entropy, and classification metrics
  2. Unsupervised Learning — Euclidean, Manhattan and cosine distances, k-NN classification, k-means clustering, PCA with covariance matrices, and DBSCAN core operations
  3. Neural Networks — The perceptron learning rule, ReLU, Leaky ReLU, tanh, softmax, and a full feed-forward layer forward pass
  4. Model Evaluation — Deterministic train/test splitting, stratified ratios, L1/L2 regularization, elastic net, and the ridge gradient

Let's begin with the simplest model in all of machine learning.

Next →