Phase 2 of 6 · Weeks 2132

Phase 2 — Classical Machine Learning

Every classical algorithm implemented by hand before you are allowed to import it — because sklearn is easy and understanding is not.

What you'll be able to do

  • Train a model by implementing gradient descent and the normal equation, then compare them
  • Build logistic regression from scratch and evaluate it on an imbalanced dataset
  • Explain the bias-variance tradeoff using two examples from your own experiments
  • Detect data leakage and set up honest train/validation/test splits
  • Choose between precision, recall, F1 and AUC — and justify the choice for a given problem
  • Cluster unlabelled data with k-means and reduce its dimensionality with PCA

What you need before you start

Assumed on day one

  • Phase 1, or equivalent: derivatives, vectors and matrices, probability
  • NumPy fluency — array indexing, broadcasting, vectorised operations
  • Comfort reading a loss function and knowing what it is minimising

Taught here — not assumed

  • Empirical risk minimisation, hypothesis spaces and generalisation
  • Regularisation — L1, L2 and Elastic Net — and the geometry of why it works
  • Cross-validation, calibration, learning curves and hyperparameter search
  • Decision trees, random forests and gradient boosting
  • Support vector machines and the kernel trick

Week by week (12 weeks)

  1. W21ML Foundations
  2. W22Linear Regression
  3. W23Logistic Regression & Classification
  4. W24Evaluation & Model Selection
  5. W25Decision Trees
  6. W26Ensembles I — Bagging & Random Forests
  7. W27Ensembles II — Boosting
  8. W28SVMs & Kernels
  9. W29Clustering
  10. W30Dimensionality Reduction
  11. W31Naive Bayes, k-NN, Anomaly Detection
  12. W32Feature Engineering + Phase 2 Capstone

What you'll build

  • Linear regression from scratch in NumPy, benchmarked against sklearn on a housing dataset
  • Logistic regression from scratch with a full precision/recall/ROC evaluation
  • A written explanation of bias-variance in your own words, with two concrete examples
  • An end-to-end model-selection study with cross-validation and leakage checks

Free, no-signup explainers and interactive demos covering this phase's ideas.

Questions about this phase

Why implement algorithms from scratch when sklearn exists?
Because a one-line `fit()` call teaches you nothing about why a model fails. Building it once means you can debug it forever. You use sklearn immediately afterwards — as a benchmark against your own implementation.
Is classical ML still worth learning in the age of LLMs?
Yes. Evaluation discipline, regularisation, the bias-variance tradeoff and leakage detection carry directly into deep learning and generative AI. Most production failures are classical-ML failures.
What maths does Phase 2 assume?
Derivatives, matrix multiplication, and basic probability — all covered in Phase 1. If you are unsure, the readiness check tells you which specific foundations to review.

Start with a real lesson, not a sales page.

Play through a complete lesson — predict, explore the demo, prove you've got it. No account, no card.