Naive Bayes ML Lecture
- 16Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
- spaceFlip card
- KI knew it
- DI didn't know it
- ←Previous card
- →Next card
What are the two main philosophies for estimating parameters in probabilistic models?
Maximum Likelihood Estimation (MLE) and Maximum a Posteriori (MAP) estimation.
Or swipe the card
16 cards
What are the two main philosophies for estimating parameters in probabilistic models?
Maximum Likelihood Estimation (MLE) and Maximum a Posteriori (MAP) estimation.
How does MLE differ from MAP in terms of the objective function?
MLE maximizes the log-likelihood: argmaxθlogP(data∣θ). MAP adds a prior term: argmaxθ[logP(data∣θ)+logP(θ)].
What is the Laplace prior and why is it used for Bernoulli parameter estimation?
The Laplace prior is a Beta(2,2) distribution, which corresponds to one imaginary success and one imaginary failure before seeing data. It prevents probabilities of 0 or 1.
In the classification problem, what do X and Y represent?
X is a vector of input features (e.g., binary indicators for movies or words). Y is the class label (e.g., 0 or 1) to be predicted.
What is the notation for the j-th feature of the i-th training example?
Xj(i) where superscript i indexes the example and subscript j indexes the feature.
What is the brute-force Bayes classifier's decision rule for a binary output?
Predict y^=argmaxy∈{0,1}P(y∣X)=argmaxyP(X∣y)P(y) after dropping the denominator P(X).
Why does brute-force Bayes become impractical with many binary features?
The number of parameters grows exponentially as O(2m) where m is the number of features, because we need a probability for each combination of feature values given Y.
What is the naive Bayes assumption?
The features are conditionally independent given the class label Y: P(X1,X2,…,Xm∣Y)=∏i=1mP(Xi∣Y).
Write the naive Bayes classifier's prediction formula for a binary output.
y^=argmaxy∈{0,1}P(y)∏i=1mP(Xi∣y)
How are the parameters P(Y=y) and P(Xi=1∣Y=y) estimated using MLE?
P(Y=y)=total examplescount(Y=y) and P(Xi=1∣Y=y)=count(Y=y)count(Xi=1 and Y=y).
How does MAP with Laplace smoothing modify the MLE estimates for P(Xi=1∣Y=y)?
P(Xi=1∣Y=y)=count(Y=y)+2count(Xi=1 and Y=y)+1
Why is Laplace smoothing important in naive Bayes?
It prevents zero probabilities for any feature-class combination, which would otherwise make the entire product zero and destroy the prediction.
Why are log-probabilities often used in naive Bayes implementations?
To avoid numerical underflow when multiplying many small probabilities, which can be represented as sums of log-probabilities.
What is a test set and why is it used in classification?
A test set is a set of labeled examples held out from training, used to evaluate the classifier's performance on unseen data.
Define accuracy, precision, and recall in the context of binary classification.
- Accuracy: total predictionscorrect predictions
- Precision: true positives+false positivestrue positives
- Recall: true positives+false negativestrue positives
How was naive Bayes applied to spam classification?
Features Xi indicate whether a specific word (from a large vocabulary) appears in the email. The class Y is spam (1) or not spam (0). The naive Bayes assumption makes training feasible despite tens of thousands of features.

Ask anything
We've read this whole study set, so questions about it get the best answers.