ML Study Hub

Home / Study together / Weeks 1-12 together

MLF + MLT + MLP: weeks 1-12 together

Everything, interrelated: one map, one path, one End Term plan.

The whole course as one story

Think of it like this

Imagine learning to cook. First you learn your knives and heat (MLF's maths). Then you learn recipes (MLT's algorithms). Then you actually cook in a real kitchen with a timer (MLP's scikit-learn). Weeks 9 to 12 are the final course: dishes that need everything, like logistic regression, SVMs, ensembles and neural networks. Each of them is a recipe (MLT) built from an optimisation tool (MLF) that you run in code (MLP).

Tip

Exams covered. The End Term of each course covers all twelve weeks, so this page is the End Term plan for MLF, MLT and MLP together. It also contains both quizzes (weeks 1 to 4 and 5 to 8, boundaries inferred from past papers). Weeks 9 to 12 are the third block: the lessons are listed below, and weeks 5 to 8 and weeks 1 to 4 are the first two.

The 12-week map

The idea

Notice the shifts. The MLP lanes are not in lock-step with MLT: MLP teaches logistic regression (W5) and SVM code (W8) before MLT's theory (W9 and W10), and MLP W9 to W10 (trees, forests) trail MLT W7 and W11. That is why the braided plans pair lessons by idea, not by week number.

Idea map: where each big idea appears in all three courses

Big ideaMLF (the tool)MLT (the algorithm)MLP (the code)
Distance and dot productW1W2 kernels, W3 k-means, W7 k-NNKNeighborsClassifier, KMeans
Derivative =0=0 and gradientW2, W7W3 centroid, W4 MLE, W5 least squares, W9 logisticSGDRegressor, LogisticRegression
Projection, least squaresW3W1 PCA, W5 regressionLinearRegression, PCA
Eigen and SVDW4, W5, W6W1 PCA, W2 kernel PCA, W6 ridgePCA, Ridge
ConvexityW8W5, W6, W9, W10 (all convex losses)choosing solvers, C, alpha
Constraints, Lagrange, KKTW9W10 SVM dual, support vectorsSVC(C, kernel, gamma)
Probability and BayesW10W4 Bayes, W8 Naive Bayes, W9 logisticGaussianNB, predict_proba
Exponential family, MLEW11, W12W4 MLE, GMMGaussianMixture
EMW12W4 GMM, EMGaussianMixture (W12)
Combine many weak models-W11 bagging, boostingW9 and W10 forests, boosting
Layers of non-linearityW2 and W7 gradientsW12 networks, backpropW11 MLPClassifier
  1. Stage A: weeks 1 to 4. The nine-session braided plan. Add MLP weeks 1 and 2.
  2. Stage B: weeks 5 to 8. The sixteen-session plan, which includes MLP weeks 3 to 8.
  3. Stage C: weeks 9 to 12. The plan below. After it, repeat the quick quiz of every week and then sit full End Term papers.

Stage C braided plan (weeks 9 to 12)

#SessionReadWhy nowTime
1Constrained optimisation, Lagrange, KKTMLF week 9SVMs are exactly a constrained problem90 min
2Perceptron and logistic regressionMLT week 9logistic regression is MLF 9's example; GD is MLF 780 min
3Support vector machinesMLT week 10uses Lagrange and KKT from session 1 and kernels (MLT 2)100 min
4Probability for MLMLF week 10the language of every probabilistic model that remains80 min
5Exponential familyMLF week 11Gaussian, Bernoulli and Poisson fit one pattern; logistic regression becomes natural70 min
6Estimation and EMMLF week 12the full theory behind MLT 4's GMM and EM90 min
7Decision trees and ensembles in codeMLP week 9MLT 7 trees, now with max_depth, n_estimators60 min
8Bagging, boosting, AdaBoostMLT week 11explains why forests and boosting work90 min
9Forests, boosting and tuning in codeMLP week 10hyper-parameter counts are a favourite exam question60 min
10Neural networksMLT week 12stacks logistic regressions; training is MLF 7's gradient descent100 min
11Neural networks in codeMLP week 11shapes, parameters, activation, adam60 min
12Unsupervised learning in codeMLP week 12closes the loop with PCA, k-means and GMM from weeks 1 to 460 min

Four problems that tie the whole course together

Your turn: 1. Logistic regression is optimisation, probability and code at once (MLF 9, MLT 9, MLP 5)

For one example with label y=1y=1 and score z=wTx+b=0z=\mathbf w^T\mathbf x+b=0, the logistic loss is −ln⁡σ(z)-\ln\sigma(z) with σ(z)=11+e−z\sigma(z)=\frac1{1+e^{-z}}. (a) Find σ(0)\sigma(0) and the loss. (b) The derivative of the loss with respect to zz is σ(z)−y\sigma(z)-y. What is it here? (c) Which way does gradient descent move zz?

Need a hint?

At z=0z=0 the model says "50-50".

Show the full solution

(a) σ(0)=12\sigma(0)=\frac12, so the loss is −ln⁡12=ln⁡2≈0.693-\ln\frac12=\ln2\approx\mathbf{0.693}. (b) σ(0)−1=−0.5\sigma(0)-1=\mathbf{-0.5}. (c) GD moves against the gradient, so zz increases: the score for a true positive is pushed up, raising σ(z)\sigma(z) towards 11. In MLP this is LogisticRegression (or SGDClassifier(loss="log_loss")); in MLT it is the discriminative model; in MLF it is "logistic regression as an optimisation problem".

Your turn: 2. The SVM margin from a Lagrange point of view (MLF 9 and MLT 10 and MLP 8)

A separating hyperplane has w=(3,4)\mathbf w=(3,4). (a) Find the margin width 2∥w∥\frac{2}{\|\mathbf w\|}. (b) If the optimiser doubles w\mathbf w to (6,8)(6,8) with the same constraints yi(wTxi+b)≥1y_i(\mathbf w^T\mathbf x_i+b)\ge1, what happens to the margin? (c) In SVC, what does a larger C do?

Need a hint?

∥w∥=9+16\|\mathbf w\|=\sqrt{9+16}.

Show the full solution

(a) ∥w∥=5\|\mathbf w\|=5, so the margin is 25=0.4\frac25=\mathbf{0.4}. (b) ∥w∥=10\|\mathbf w\|=10, margin =0.2=\mathbf{0.2}: smaller ∥w∥\|\mathbf w\| means a wider margin, which is why the SVM minimises 12∥w∥2\frac12\|\mathbf w\|^2 under the constraints. The Lagrange/KKT machinery of MLF week 9 solves that, and only the points on the margin (the support vectors) get non-zero multipliers. (c) A larger C penalises margin violations more: a narrower margin that fits the training data harder (less regularisation).

Your turn: 3. The coin, the prior and the bias (MLF 10 to 12 meet MLT 4)

A coin shows 7 heads in 10 flips. (a) Find the MLE of pp. (b) With a Beta(2,2)\text{Beta}(2,2) prior, find the posterior mode (MAP). (c) Why is it between the MLE and 0.50.5?

Need a hint?

For Beta(α,β)\text{Beta}(\alpha,\beta) and hh heads in nn flips, the posterior is Beta(α+h,β+n−h)\text{Beta}(\alpha+h,\beta+n-h) with mode α+h−1α+β+n−2\frac{\alpha+h-1}{\alpha+\beta+n-2}.

Show the full solution

(a) p^=710=0.7\hat p=\frac7{10}=\mathbf{0.7}. (b) Posterior Beta(9,5)\text{Beta}(9,5), mode =2+7−12+2+10−2=812=0.667=\frac{2+7-1}{2+2+10-2}=\frac8{12}=\mathbf{0.667}. (c) The prior Beta(2,2)\text{Beta}(2,2) is centred at 0.50.5, so it pulls the estimate from 0.70.7 towards 0.50.5. With more data the pull weakens. This is the same "shrinkage" idea as ridge: a prior on the weights is a penalty.

Your turn: 4. Counting skills you meet in MLP (MLT 11 meets MLP 9 and 10)

A grid search tries n_estimators∈{50,100,200}n\_estimators\in\{50,100,200\} and max_depth∈{3,5}max\_depth\in\{3,5\} with 5-fold cross-validation and a final refit. (a) How many models are fitted in total? (b) A one-vs-one SVM on 4 classes trains how many classifiers? (c) A network has layers 4→5→34\to5\to3: how many parameters (weights plus biases)?

Need a hint?

Combinations ×\times folds (+1+1); K(K−1)/2K(K-1)/2; ∑(mn+n)\sum(mn+n).

Show the full solution

(a) 3×2=63\times2=6 combinations, 6×5=306\times5=30 fits, plus 11 refit =31=\mathbf{31}. (b) 4⋅32=6\frac{4\cdot3}{2}=\mathbf6 (one-vs-rest would be 44). (c) (4⋅5+5)+(5⋅3+3)=25+18=43(4\cdot5+5)+(5\cdot3+3)=25+18=\mathbf{43}.

How the three courses relate in the exam

MLFMLTMLP
Stylederivations and calculations by handalgorithm steps and short calculationsreading scikit-learn code, defaults and counts
Biggest weightslinear algebra, optimisation, probabilityPCA, regression, SVM, ensembles, EMpipelines, SGD, metrics, grid-search counts
Where to lookMLF patternsMLT patternsMLP patterns

The three patterns pages show which topics have actually repeated in past papers. Use them to decide where extra revision time goes.

Pace options

The idea

12 weeks, one week of everything per week (the table above, read by row).

6 weeks: two weeks per week: A (1 to 4), B (5 to 8) and C (9 to 12) as three blocks of two weeks each.

3-week End Term sprint if you already know weeks 1 to 8: Week 1 the Stage C plan; Week 2 one full End Term paper per course; Week 3 the patterns pages plus the wrong-answer review.

Last 3 days: Day 1 all the formula sheets; Day 2 the real exam questions of weeks you rated weakest; Day 3 one timed paper and the glossary.

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.