← Back to Classic ML Mind Map
⚡Flashcard Drill➔
📊 Classic MLID: naive-bayes

Naive Bayes

朴素贝叶斯
🎯Core Definition
Naive Bayes is a generative classifier built on Bayes' theorem; its core assumption is that features are conditionally independent given the class CC. By Bayes' theorem
📌Overview
P(C∣x)∝P(C)∏iP(xi∣C),P(C \mid x) \propto P(C)\prod_{i} P(x_i \mid C),
📌Overview
the prior P(C)P(C) times the feature-likelihood product yields the posterior, and the class with maximum posterior is predicted — the normalizer P(x)P(x) is the same for all classes and cancels under argmax. The parameterization defines three variants: Multinomial NB (count features, multinomial distribution, for word counts in text), Gaussian NB (continuous features fit as P(xi∣C)=N(xi;μC,i,σC,i2)P(x_i \mid C) = \mathcal{N}(x_i; \mu_{C,i}, \sigma_{C,i}^2)), and Bernoulli NB (binary 0/1 features, Bernoulli distribution). If a feature-class pair never appears in training, the posterior product collapses to zero, hence Laplace smoothing
📌Overview
P^(xi∣y)=Ny,xi+αNy+α∣V∣,\hat P(x_i \mid y) = \frac{N_{y,x_i} + \alpha}{N_y + \alpha |V|},
📌Overview
with NyN_y the number of class-yy samples, Ny,xiN_{y,x_i} the count of feature xix_i in class yy, ∣V∣|V| the vocabulary size, and α=1\alpha = 1 giving add-one smoothing.
💡Use Cases
text classification (spam, sentiment), fast baselines on high-dimensional sparse features, online incremental learning; interviews often ask to derive the conditional-independence posterior and compare NB with logistic regression.
⚡Key Problems Solved
a generative view over high-dimensional discrete features with parameters growing linearly, no iterative training, and streaming updates; the cost is the strong conditional-independence assumption — correlated features bias probability estimates, though classification boundaries usually remain usable and NB stays robust to noisy features.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Naive Bayes.
Use Cases
In production engineering, what are the primary use cases for Naive Bayes and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Write the NB decision rule P(C∣x)∝P(C)∏iP(xi∣C)P(C \mid x) \propto P(C)\prod_i P(x_i \mid C); what is the “naive” assumption and why can the denominator P(x)P(x) be dropped?
2
Why is Laplace smoothing needed? Write P^=Ny,xi+αNy+α∣V∣\hat P = \frac{N_{y,x_i}+\alpha}{N_y+\alpha|V|} and explain how zero probabilities are avoided.
3
What feature types are Multinomial, Gaussian, and Bernoulli NB each suited for?
4
Is NB generative or discriminative? How does it compare with logistic regression under limited data and strongly correlated features?
5
What happens when the conditional-independence assumption is violated, and why does NB still often deliver usable decisions in practice?
📖 In-depth Guide:📄 probabilistic-models →
Updated 2026-08-12
🎯
Verify Mastery: Practice Exam Questions for "Naive Bayes"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
← Previous CardPCA & SVDNext Card →HMM Forward Algorithm (Evaluation)

🔗 More Classic ML Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/ML/card/naive-bayes