Book

Learn ML Algorithms

From first principles to the one line you would ship

Every algorithm four ways: the intuition, the mathematics, an implementation from scratch, and the one line of scikit-learn you would actually ship.

This book is planned but not yet written. The chapter list below is the outline, and it will fill in over the coming months. In the meantime the Python primer,So You Want to Be a Data Scientist, has its first three chapters live.

Groundwork

  1. 1What Learning From Data MeansSupervised, unsupervised, and the one assumption every model rests on.
  2. 2Linear Regression, ProperlyLeast squares from three directions: geometry, calculus, and linear algebra.
  3. 3Gradient Descent, Seen ClearlyWhy it works, when it fails, and what the learning rate is really doing.
  4. 4Logistic Regression and ClassificationFrom a line to a probability, and why log loss rather than accuracy.

Getting It Right

  1. 5Bias, Variance and RegularisationThe single most useful decomposition in the field, with pictures.
  2. 6Cross-Validation and LeakageHow honest evaluation is constructed, and the five ways it breaks.

The Workhorses

  1. 7Decision TreesSplitting, impurity, pruning, and why a single tree is never enough.
  2. 8Random Forests and BaggingVariance reduction through disagreement.
  3. 9Gradient BoostingFitting the residual, and why this wins most tabular competitions.
  4. 10Support Vector MachinesMargins, the dual, and the kernel trick that made them famous.

Unsupervised

  1. 11Clusteringk-means, hierarchical, DBSCAN, and how to tell whether a cluster is real.
  2. 12Dimensionality ReductionPCA from the eigenvector up, plus t-SNE and UMAP and their traps.

Neural Networks

  1. 13Networks From First PrinciplesA perceptron, then backpropagation derived by hand.
  2. 14Training That ConvergesInitialisation, activation functions, normalisation, optimisers.

In Practice

  1. 15Choosing an AlgorithmA decision guide built from data shape, size, and what you must explain.