Given a dataset with 𝐾 binary-valued attributes (where 𝐾 > 2) for a…
2024
Given a dataset with 𝐾 binary-valued attributes (where 𝐾 > 2) for a two-class classification task, the number of parameters to be estimated for learning a naïve Bayes classifier is
- A.
2𝐾 + 1
- B.
2𝐾 + 1
- C.
2𝐾+1 + 1
- D.
𝐾2 + 1
Attempted by 10 students.
Show answer & explanation
Correct answer: B
Count the parameters needed for a naïve Bayes classifier with K binary attributes and two classes:
Class prior: 1 parameter (e.g., P(class = 1); the other class probability is 1 minus this).
Conditional probabilities for attributes: K parameters per class. For each binary attribute j you need P(attribute_j = 1 | class). Since there are two classes, that gives 2 × K parameters.
Total parameters = 1 (class prior) + 2K (conditional probabilities) = 2K + 1.
Quick example: if K = 3, you need 1 prior + 2×3 = 6 conditionals, so 7 parameters in total.
Note: The conditional independence assumption of naïve Bayes is what keeps the number of parameters linear in K rather than exponential (which would be the case if modeling the full joint distribution over attributes).