Module 3 Review & Cheat Sheet
1. Key Takeaways
- Bayes’ Theorem: The mathematical engine for updating beliefs with new evidence. It is the foundation of Generative AI.
- The Big 3 Distributions:
- Bernoulli: Binary outcomes (Logistic Regression).
- Gaussian: The sum of many random things (Weights, Errors).
- Poisson: Counts over time (Traffic).
- Hypothesis Testing: A framework to distinguish Signal from Noise. Beware of P-Hacking (False Positives from multiple comparisons).
- Naive Bayes: A simple yet powerful classifier that uses the “Independence Assumption” and “Log-Sum-Exp” trick to handle text at scale.
2. Cheat Sheet
| Concept | Formula / Note |
|---|---|
| Conditional Prob | P(A|B) = P(A ∩ B) / P(B) |
| Bayes’ Theorem | P(A|B) = [P(B|A)P(A)] / P(B) |
| Independence | P(A ∩ B) = P(A)P(B) |
| Expectation | E[X] = ∑ x · P(x) |
| Variance | Var(X) = E[(X-μ)<sup>2</sup>] |
| Covariance | Cov(X,Y) = E[(X-μ<sub>x</sub>)(Y-μ<sub>y</sub>)] |
| Correlation | ρ = Cov(X,Y) / (σ<sub>X</sub> σ<sub>Y</sub>) |
| Normal Dist | N(μ, σ<sup>2</sup>) |
| CLT | Sum of i.i.d. variables → Gaussian |
| Log-Sum-Exp | log(∏ p<sub>i</sub>) = ∑ log(p<sub>i</sub>) |
| Laplace Smoothing | (count + 1) / (total + V) |
3. Interview Gauntlet
Q1: Explain P-Value to a Product Manager.
“It’s the probability that the improvement we saw (e.g., +2% conversion) happened purely by luck. A low P-value means it’s likely a real improvement.”
Q2: Why do we use Log-Probabilities in Naive Bayes?
“To prevent arithmetic underflow. Multiplying many small probabilities results in zero. Logs turn multiplication into addition, which is numerically stable.”
Q3: What happens if a word is missing in Naive Bayes?
“The probability becomes zero, crashing the model. We use Laplace Smoothing (adding 1 to counts) to handle this.”
Q4: What is the difference between Generative and Discriminative models?
“Generative models (Naive Bayes) learn the joint probability
P(X,Y)—how the data is generated. Discriminative models (Logistic Regression) learn the conditional probabilityP(Y|X)—the boundary between classes.”
4. Interactive Flashcards
Test your knowledge. Click a card to flip it. Use Left/Right Arrows to navigate.