ML Study Hub

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 it like this

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.

Tip

Exams covered by this page. Quiz 1 ≈\approx weeks 1 to 4 and Quiz 2 ≈\approx 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 ×\times 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.

  1. 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.
  2. 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).
  3. 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.
The idea

Why this order works. Every idea is read just after the idea it depends on. For example: dot product (MLF 1) →\to kernel (MLT 2); projection (MLF 3) →\to PCA reconstruction (MLT 1) →\to least squares (MLT 5); eigenvalues (MLF 4) →\to symmetric matrices (MLF 5) →\to SVD (MLF 6) →\to ridge shrinkage (MLT 6).

Three problems that cross the whole half

Your turn: 1. Two ways to measure the same miss (MLT 1 meets MLT 5)

The point (0,3)(0,3) and the line y=xy=x. (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 yy. Perpendicular: drop a perpendicular to the line.

Show the full solution

(a) The line at x=0x=0 gives y=0y=0, so the vertical error is 33 and its square is 9\mathbf9. (b) The distance from (a,b)(a,b) to y=xy=x is ∣a−b∣2=32\frac{|a-b|}{\sqrt2}=\frac3{\sqrt2}, whose square is 4.5\mathbf{4.5} (the same 4.54.5 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 yy is the thing to predict, while PCA measures sideways because no variable is special.

Your turn: 2. One idea, three algorithms (MLF 2 meets MLT 3, 4 and 5)

Take the numbers 2, 4, 72,\,4,\,7. (a) Find the mm minimising ∑(xi−m)2\sum(x_i-m)^2. (b) If each xi∼N(μ,σ2)x_i\sim\mathcal N(\mu,\sigma^2), the log-likelihood is −∑(xi−μ)22σ2+const-\sum\frac{(x_i-\mu)^2}{2\sigma^2}+\text{const}. What is the MLE of μ\mu? (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) ddm∑(xi−m)2=0⇒m=xˉ=2+4+73=133≈4.33\frac{d}{dm}\sum(x_i-m)^2=0\Rightarrow m=\bar x=\frac{2+4+7}{3}=\frac{13}3\approx\mathbf{4.33}. (b) Maximising the log-likelihood is minimising the squared error, so μ^=xˉ=133\hat\mu=\bar x=\frac{13}3 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 y=wTx+y=\mathbf w^T\mathbf x+ Gaussian noise. "Set the derivative to zero on a squared error" is the engine of both.

Your turn: 3. Which of these are convex? (MLF 8 meets MLT 1, 3, 5, 6)

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 ⇒\Rightarrow no bad local minima.

Show the full solution

(i) Convex: a quadratic in w\mathbf w with a PSD matrix XTXX^TX. (ii) Convex, and even strictly (adding λ∥w∥2\lambda\|\mathbf w\|^2 makes it strongly convex). (iii) Convex, but not smooth at 00 (the ∣w∣|w| 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

CourseQuiz 1 (weeks 1 to 4) testsQuiz 2 (weeks 5 to 8) tests
MLFintro, calculus, least squares, eigenvaluessymmetric matrices, SVD/PCA, gradient descent, convexity
MLTPCA, kernel PCA, k-means, MLE, Bayes, GMM/EMregression, ridge/LASSO, k-NN/trees, Naive Bayes
MLPproject workflow, pipelines, tuning, regression codeclassification 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

The idea

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.

Course structure from the official IIT Madras BS course pages (BSCS2004 MLF, BSCS2007 MLT, BSCS2008 MLP). Past papers and answer keys come from quizpractice.space. This is an independent study aid - always check the current term's grading rules on the official course page.