Home / Study together / Weeks 1-8 together
MLF + MLT + MLP: weeks 1-8 together
The first half of the course, three lanes side by side, in one recommended order.
The first half of the course in one picture
Think of weeks 1 to 8 as a two-act story.
Act 1 (weeks 1 to 4): "Look at the data." No answers are given. You learn to measure distance, find the direction where data spreads most (PCA), group points (k-means) and guess hidden groups (GMM and EM).
Act 2 (weeks 5 to 8): "Predict from the data." Now every example has an answer. You fit a line (least squares), keep it from overfitting (ridge, LASSO), and build the first classifiers (k-NN, trees, Naive Bayes).
The maths of MLF is the toolbox that both acts keep reaching into, and MLP is where you press the buttons in Python.
Exams covered by this page. Quiz 1 weeks 1 to 4 and Quiz 2 weeks 5 to 8 in all three courses (boundaries inferred from the topics in the past papers). Doing the whole page prepares six quizzes (3 courses 2) and about half of every End Term.
The 8-week map, three lanes side by side
Read the table by row for a pace of "one week of everything", or by column to finish one course first. The braided plans below are the best order across the table.
The recommended order
- Stage A, weeks 1 to 4 together. Follow the nine-session MLF and MLT weeks 1 to 4 plan. Add MLP week 1 and week 2 alongside it: they are about how a project is organised and do not need the maths.
- Stage B, weeks 5 to 8 together. Follow the sixteen-session weeks 5 to 8 plan. It pulls in MLP weeks 3 and 4 (regression code) and weeks 5 to 8 (classification code).
- Between the stages, do one full Quiz 1 per course as a checkpoint, and fix every wrong answer before going on: Stage B leans on Stage A.
Why this order works. Every idea is read just after the idea it depends on. For example: dot product (MLF 1) kernel (MLT 2); projection (MLF 3) PCA reconstruction (MLT 1) least squares (MLT 5); eigenvalues (MLF 4) symmetric matrices (MLF 5) SVD (MLF 6) ridge shrinkage (MLT 6).
Three problems that cross the whole half
The point and the line . (a) What is the vertical squared error (what least-squares regression minimises)? (b) What is the perpendicular squared distance (what PCA minimises)?
Need a hint?
Vertical: change only . Perpendicular: drop a perpendicular to the line.
Show the full solution
(a) The line at gives , so the vertical error is and its square is . (b) The distance from to is , whose square is (the same as the PCA reconstruction error in the weeks 1 to 4 plan). Regression and PCA both fit a line, but regression measures error up and down because is the thing to predict, while PCA measures sideways because no variable is special.
Take the numbers . (a) Find the minimising . (b) If each , the log-likelihood is . What is the MLE of ? (c) Name the algorithm in each of MLT weeks 3 and 5 that is secretly this calculation.
Need a hint?
(a) and (b) are the same minimisation.
Show the full solution
(a) . (b) Maximising the log-likelihood is minimising the squared error, so too: the Gaussian MLE is the mean. (c) k-means (week 3) moves each centre to the mean of its points. Least squares (week 5) is the MLE when Gaussian noise. "Set the derivative to zero on a squared error" is the engine of both.
For each, say whether the objective is convex (so GD finds the global minimum) and what that means in practice: (i) least squares, (ii) ridge, (iii) LASSO, (iv) k-means, (v) the PCA objective.
Need a hint?
Convex no bad local minima.
Show the full solution
(i) Convex: a quadratic in with a PSD matrix . (ii) Convex, and even strictly (adding makes it strongly convex). (iii) Convex, but not smooth at (the corner), so use subgradients or coordinate descent. (iv) Not convex: different starting centres can end in different answers, so scikit-learn runs several (n_init). (v) Not convex as written, but it has an exact answer through the eigenvectors (week 4), so you never need GD for it.
Exam map for the first half
| Course | Quiz 1 (weeks 1 to 4) tests | Quiz 2 (weeks 5 to 8) tests |
|---|---|---|
| MLF | intro, calculus, least squares, eigenvalues | symmetric matrices, SVD/PCA, gradient descent, convexity |
| MLT | PCA, kernel PCA, k-means, MLE, Bayes, GMM/EM | regression, ridge/LASSO, k-NN/trees, Naive Bayes |
| MLP | project workflow, pipelines, tuning, regression code | classification code, metrics, multiclass, SVM options |
Use each lesson's exam radar chip and the course's exam patterns page to see which topics are most repeated.
Pace options
8 weeks, one week of everything per week: read the three lanes of the week in the order MLF, MLT, MLP.
4 weeks, two weeks per week: Stage A in weeks 1 and 2 of your plan, Stage B in weeks 3 and 4.
10 days, crash: Days 1 to 3 the 3-day weeks 1 to 4 crash plan, Day 4 a Quiz 1 paper, Days 5 to 8 the 4-day weeks 5 to 8 plan, Day 9 a Quiz 2 paper, Day 10 revision of wrong answers.
Next: weeks 1 to 12 together for the full course.