Machine Learning — Complete Course from the 21 Lecture PDFs

Source folder: ML_Notes (Dr. Tanmay Basu’s Machine Learning, Summer 2024 lecture notes, plus the Bishop PCA excerpt). All 21 PDFs were processed and unified into 54 concepts across 10 modules. Each concept has: intuition, formal definition, mathematics/derivation, key insights, exactly 5 worked examples (very easy → very hard) with Python checks, common mistakes, exam traps, connections, mastery checklist.

How to read

Follow the modules in order — each assumes the previous ones. Example 5 of each concept is the “exam-level” one. If you spot a slip, treat the derivation, not the final number, as authoritative.

Study aids in every module (second edition)

  • Callouts: > [!abstract] intuition · > [!success] key lesson per example · > [!warning] common mistakes · > [!danger] exam traps. In Obsidian, fold or unfold them with the arrow on the left.
  • Python checks: every hard example has a collapsed > [!example]- Python check block. Each module also starts with a collapsed helpers block — run it first. Every number in the notes was re-verified with numpy / scipy / scikit-learn (versions: numpy 2.3, scipy 1.16, scikit-learn 1.8).
  • Diagrams: Mermaid flowcharts and small ASCII sketches for trees, margins, dendrograms, DBSCAN, PCA, networks and backprop.
  • Everyday framing: examples use concrete settings (spam filter, fraud, exam hours, plant sensors, customer segments, iris flowers) with the same numbers as the lecture versions, so the maths is unchanged.
  • Wikilinks: [[file|C##]] jumps to the module that owns a concept; the graph view shows how modules connect.
  • A copy of the original notes is in ../ML_notes_backup/.

Course map

#FileConceptsSource lectures
001_FoundationsC1 What is ML · C2 Supervised (classification/regression) · C3 Unsupervised & feature engineeringLec 2
102_Decision_Trees_and_Random_ForestsC4 Entropy & IG · C5 Gini · C6 Gain ratio · C7 Stopping & overfitting · C8 Pruning (REP, CCP, EBP) · C9 ID3/C4.5/CART, merits & limits · C10 Random forestLec 3–4
203_Evaluation_and_Model_SelectionC11 Confusion matrix, accuracy, P/R/F · C12 Macro/micro, sensitivity/specificity, imbalance · C13 Cross-validation (LOO, -fold)Lec 5, 6
304_Bayes_Decision_Theory_and_Naive_BayesC14 Bayes rule · C15 Bayes error & optimality · C16 Chernoff/Bhattacharyya · C17 Minimum distance classifier · C18 Linear discriminant · C19 Naive Bayes · C20 Gaussian NB · C21 Multinomial NB + Laplace · C22 Bernoulli NBLec 7, 8
405_k_Nearest_NeighbourC23 kNN · C24 Distance-weighted kNN · C25 Tweaked kNNLec 9
506_Regression_and_Logistic_ModelsC26 Linear regression · C27 Logistic regression · C28 Softmax · C29 Generative vs discriminativeLec 10, 11
607_Support_Vector_MachinesC30 Hard-margin geometry · C31 Lagrange dual & KKT · C32 Soft margin · C33 Kernel trick · C34 Valid kernelsLec 13, 14, 15
708_ClusteringC35 Clustering formulation · C36 k-means · C37 Bisecting & Buckshot · C38 k-medoids · C39 Agglomerative linkages · C40 Divisive & DBSCAN · C41 Cluster F-measure · C42 NMILec 16–19
809_Principal_Component_AnalysisC43 Orthonormal bases · C44 PCA max-variance · C45 PCA min-error · C46 Algorithm, standardisation, whitening · C47 PCA for · C48 Applications & Fisher comparisonLec 20, Bishop §12.1
910_Perceptrons_and_Neural_NetworksC49 Perceptron · C50 Convergence theorem · C51 Batch perceptron · C52 XOR & MLP · C53 Feedforward architecture · C54 BackpropagationLec 21, 22, 23

PDF Coverage Checklist

PDFTopics CoveredConcepts Covered (where)Status
Lec2 Introduction to Machine LearningSamuel/Mitchell definitions; supervised (classification, regression); unsupervised (clustering, density estimation); feature selection vs extraction; applicationsC1–C3 (01)✓ Complete
Lec3-4 Decision Tree and Random Forest ClassifiersTree structure; weather dataset; entropy/IG; Gini; gain ratio; stopping criteria; overfitting; REP, cost-complexity, error-based pruning; ID3, C4.5, CART; merits/limits; random forest, OOB (all figures 3.1–3.5 checked)C4–C10 (02); weather data worked end-to-end✓ Complete
Lec5 Evaluation Criteria for Data ClassificationConfusion matrix; accuracy; precision/recall/F; macro vs micro averaging; class imbalance; sensitivity/specificityC11–C12 (03)✓ Complete
Lec6 Parameter Tuning for Data ClassificationCross-validation; leave-one-out; -fold (fold conditions i–iv); repeated runsC13 (03)✓ Complete
Lec7 Bayes Decision Rule for Data ClassificationPriors/posteriors; Bayes rule; error probability and optimality; equal-variance Gaussian error ; ; Chernoff/Bhattacharyya; minimum distance classifier; linear discriminantC14–C18 (04)✓ Complete
Lec8 Naive Bayes ClassifierConditional independence; MAP; log-space; Gaussian, multinomial (Laplace), Bernoulli NBC19–C22 (04)✓ Complete
Lec9 k-Nearest Neighbor Decision RulekNN algorithm; choice of ; 1-NN vs Bayes error; distance-weighted kNN; TkNN with ; the 9-element sequence exampleC23–C25 (05)✓ Complete
Lec10 Linear RegressionLeast squares; normal equations; basis expansionsC26 (06)✓ Complete
Lec11 Logistic RegressionSigmoid; likelihood/cross-entropy; gradient; softmax; one-hot; discriminative vs generativeC27–C29 (06)✓ Complete
Lec13 SVM (Hard Margin)Separability/convex hull; margin ; support vectors; Lagrangian, dual, KKT; computing C30–C31 (07)✓ Complete
Lec14 SVM (Soft Margin)Slack variables; objective with ; Lagrangian with ; box constraint; KKT cases; role of C32 (07)✓ Complete
Lec15 SVM Using KernelsFeature map; kernel trick; polynomial-kernel derivation; symmetric/PSD/Mercer; polynomial, Gaussian, sigmoid kernels; RBF network view; the example with etc.C33–C34 (07)✓ Complete
Lec16 Overview of Data ClusteringPartition axioms; hierarchical vs partitional; loss ; convex-shaped clusters; half-spacesC35 (08)✓ Complete
Lec17 Partitional Clustering TechniqueLloyd’s k-means; MacQueen variant; bisecting k-means; Buckshot; k-medoids (two medoid definitions)C36–C38 (08)✓ Complete
Lec18 Hierarchical Clustering TechniqueAgglomerative; single/complete/average linkage; chaining; divisive; DBSCANC39–C40 (08)✓ Complete
Lec19 Evaluation Criteria for ClusteringCluster F-measure; mutual information; NMIC41–C42 (08)✓ Complete
Lec20 PCA for Dimensionality ReductionPCA algorithm; orthonormal bases; min-error derivation; Lagrangian; eigen-decomposition; appendix expansionC43–C46 (09)✓ Complete
PCA_Bishop_Book (§12.1, pp. 561–570)Max-variance formulation; min-error formulation; applications (compression, pre-processing, standardising, whitening, visualisation); PCA vs Fisher; PCA for ; probabilistic PCA (introduced)C44–C48 (09)✓ Complete
Lec21 Perceptron Learning AlgorithmPerceptron; update rule; convergence proof; salient points; batch version and cost C49–C51 (10)✓ Complete
Lec22 Multilayer Perceptron Learning AlgorithmOR/AND perceptrons; XOR problem; two-layer perceptron; hidden-layer mappingC52 (10)✓ Complete
Lec23 ANN and BackpropagationArchitecture; notation; forward computation; squared-error risk; recursion; backpropagation algorithm; remarksC53–C54 (10)✓ Complete

Method notes (honesty about the processing)

  • Text of every PDF was extracted programmatically and read in full. Figures were spot-checked as images (Lec 3-4 Figs 3.3/3.5; Lec 16, 18, 22, 23 figures); others were reconstructed from captions and surrounding text, and all agree with the written content.
  • The Bishop excerpt is a scanned page image whose OCR text is garbled; its mathematics (eqs. 12.1–12.30) was rebuilt and cross-checked against Lec 20, which derives the same results.
  • §12.2 “Probabilistic PCA” is only introduced on the last page provided; it is described but not developed.

Source errata and clarifications (corrected silently in the text; listed here for transparency)

LectureIssue in the notesCorrect statement used here
3–4
3–4Gain-ratio denominator written Split information $-\sum\frac{
3–4”Gini index is used to prune” (CART)CART splits by Gini, prunes by cost-complexity
3–4""
3–4Random forest “low variance and bias”Mainly reduces variance; bias stays about that of a deep tree
7”minimum of posteriors” in Minimum of the joint
91-NN error “twice Bayes” (as )
11”loss function is linear in “Boundary linear; loss convex (not linear); sigmoid range is for
13Min called the “dual”Equivalent primal; true dual is ; "" ⇒
13/14” only for SVs”; margin violators “are not SVs”All points with are SVs; are violators; a point on the margin can have
14
15Gaussian kernel (otherwise not PSD)
15Example lists “positive class” twice; 7-vector has a repeated component; polynomial kernel ""Second list is the negative class; verify before use; integer (the lecture uses )
17Medoid defined as minimax and as minimum-average-distanceBoth forms discussed; they can differ on ties
20; “least eigenvalues”; independence definition garbled; least ; independence ⇔ only the trivial combination is
21”Cannot find a bound on the number of iterations”A bound exists but depends on the unknown margin; sign in 21.15 should give
23Mixed indexing in ; (23.6) per-sample vs (23.7) summedOnline vs batch gradient descent; assumes squared error

One-page formula sheet

Information. ; ; ; . Evaluation. , , ; spec . Bayes. decide ; equal-var Gaussian error ; NB: ; Laplace . kNN. vote of nearest; weights ; TkNN: stop when margin . Regression. ; logistic ; softmax gradient . SVM. margin ; ; ; ; , . Clustering. Lloyd: assign nearest, update means; linkages min/max/mean; NMI . PCA. ; ; ; whitening ; : . Neural nets. perceptron ; mistake bound ; backprop , , .