AID202 · Foundations of Machine Learning

Lectures 7–8 · MLE, MAP & Naïve Bayes

Eight classroom activities that turn probability assumptions, likelihood, priors, Bayes’ rule, and Naïve Bayes into things students can manipulate and test.

DependenceLikelihoodMLEMAPBayes ruleNaïve Bayes
8–10 min · Lecture 7

1. Dependence can disappear when we condition

Use rain as a hidden variable in the coats-and-accidents example. See marginal association appear even though coats and accidents are independent within each weather condition.

Open activity
12–15 min · Lecture 7

2. Coin MLE: likelihood you can see

Flip a coin, watch the likelihood curve change, locate the MLE, compare 5 vs. 50 flips, and calculate how many samples Hoeffding’s inequality asks for.

Open activity
10–12 min · Lecture 7

3. Gaussian MLE and the variance bias

Estimate μ and σ² from continuous samples, inject an outlier, then repeat the experiment hundreds of times to see why the MLE variance is biased.

Open activity
12–15 min · Lecture 8

4. MLE vs. MAP: prior meets data

Move a Beta prior, add heads and tails, and see prior, likelihood, and posterior together. Compare MLE and MAP and watch the prior get washed out.

Open activity
10–12 min · Lecture 8

5. Bayes rule and the base-rate effect

Recreate the diagnostic-test example using expected counts. Then add a conditionally independent follow-up test and see why two different tests can be much more informative.

Open activity
12 min · Lecture 8

6. Why the Naïve Bayes assumption helps

Compare parameter counts with and without conditional independence, then assemble a posterior feature-by-feature and see what happens when evidence is duplicated.

Open activity
12–15 min · Lecture 8

7. Text Naïve Bayes & Laplace smoothing

Use the Chinese/Tokyo/Japan example from the lecture, edit the test document, turn smoothing on and off, and verify that word order does not matter in the bag-of-words model.

Open activity
8–10 min · optional Lecture 8 extension

8. Gaussian Naïve Bayes

Move a continuous 2-D query point through two class models and inspect the per-feature Gaussian likelihoods that combine into the class posterior.

Open activity