Probabilistic & Bayesian Learning: Cheat Sheet
Assembled from the matching per-unit cheat-sheet slices. The whole topic compressed for the night before the exam.
Bayesian learning
- Bayes: . Posterior ∝ Likelihood × Prior.
- MAP: .
- ML: , which equals MAP when the prior is uniform.
- Size principle: favour the smallest consistent hypothesis - Occam's razor in probabilistic form.
against , so . Normalised, that is 0.21 / 0.79. Priors dominate.
- Brute-force MAP: a consistent
hhasP(h|D) = 1/|VS|, uniform over the version space. - Find-S outputs a MAP hypothesis given a uniform prior and noise-free data, despite using no probabilities.
- ML = least squares under Gaussian noise: .
- For predicting probabilities, the same argument gives cross-entropy instead.
- Bayes Optimal Classifier: - combines all hypotheses and can beat MAP (the 0.4 / 0.6 example).
- Gibbs: pick one
hat random by the posterior. Expected error at most 2× the Bayes optimal.
Naive Bayes
- , assuming conditional independence given the class.
- Play Tennis on
(Sunny, Cool, High, Strong): YES ≈ 0.0053, NO ≈ 0.0206, so the answer is NO. - Text: bag-of-words, and Laplace smoothing
(count+1)/(words_in_class+|vocab|)fixes the zero-probability problem.
EM
- MLE in the presence of latent variables. E-step: estimate the hidden data. M-step: maximise the parameters. Converges to a local maximum.
- K-means is EM: E assigns each point to the nearest centroid, M recomputes the centroids. GMM is the soft version, using responsibilities.
- Two coins: identities known means just counting, and ; identities unknown means EM.
Markov and HMM
- Markov property: the next state depends only on the current state - memoryless. Transition matrix rows sum to 1, row is FROM and column is TO.
- Weather sequence: .
λ = (π, A, B): π is initial, A is transition, B is emissionP(obs|state). Hidden states, observed emissions.- Problem 1, Likelihood → Forward. Problem 2, Decoding → Viterbi. Problem 3, Learning → Baum-Welch (EM).
- Forward: ; ; . Worked example gives P(O) = 0.03532.
- Backward: ; .
- Gamma: , and each column sums to 1. is the α·β dot product of any column.
- Viterbi is Forward with max instead of sum, plus backpointers, giving the best state sequence.
End of Unit 3 notes. Every slide topic from the Unit 3 folder (L25 to L36) is covered across this topic.
- The Naive Bayes Play Tennis YES score is ≈ 0.0053; the slide showed 0.0211. The conclusion NO is unaffected.
- All HMM forward, backward and gamma tables, and the cancer and text-classification numbers, were independently recomputed and verified.