Skip to the content

What This Unit Is About

Supervised learning is the setting most people mean when they say “machine learning”. You are given pairs \((\mathbf{x}_i, y_i)\) — features and the answer — and the task is to learn a function \(f\) such that \(f(\mathbf{x}) \approx y\) on data drawn from the same distribution. Everything else in this unit follows from two questions: what shape is \(y\), and what shape do you allow \(f\) to take?

Learning Outcomes

By the end of this unit you should be able to:

  1. State what separates a generative classifier (Naive Bayes) from a discriminative one (Logistic Regression), and when each is preferable.
  2. Derive and interpret the decision boundary of a linear classifier, and explain what a kernel buys you when the boundary is not linear.
  3. Fit a regression model by ordinary least squares, and read its coefficients, \(R^2\) and residual diagnostics correctly.
  4. Choose between L1 and L2 regularisation from the structure of the problem, not by trial and error.
  5. Explain how bagging reduces variance, and why decorrelating the trees is what makes a Random Forest work.

Topics in This Unit

1.1

🔖 Classification

Predicting which class a point belongs to: probabilistic, linear, instance-based, margin-based and tree-based approaches.

5 algorithms • Naive Bayes Classifier, Logistic Regression, K-Nearest Neighbors (KNN), Support Vector Machine (SVM), Decision Tree (Classification)
1.2

📉 Regression

Predicting a number: least squares, basis expansion, the two regularisation penalties, and an ensemble of trees.

5 algorithms • Linear Regression, Polynomial Regression, Ridge Regression (L2 Regularisation), Lasso Regression (L1 Regularisation), Random Forest Regression

Every Algorithm in Supervised Learning

No.AlgorithmCharacterTopic
1.1Naive Bayes ClassifierProbabilistic • Generative1.1 Classification
1.2Logistic RegressionLinear • Discriminative1.1 Classification
1.3K-Nearest Neighbors (KNN)Instance-Based • Non-Parametric1.1 Classification
1.4Support Vector Machine (SVM)Margin Maximisation • Kernel Methods1.1 Classification
1.5Decision Tree (Classification)Tree-Based • Interpretable1.1 Classification
1.6Linear RegressionParametric • Closed-Form1.2 Regression
1.7Polynomial RegressionNon-Linear • Feature Engineering1.2 Regression
1.8Ridge Regression (L2 Regularisation)Regularisation • Shrinkage1.2 Regression
1.9Lasso Regression (L1 Regularisation)Regularisation • Feature Selection1.2 Regression
1.10Random Forest RegressionEnsemble • Bagging1.2 Regression