How is Bayes' theorem adapted into a decision rule for classification?

Quick Overview

Asks how Bayes' theorem becomes a decision rule that assigns a class label, as in naive Bayes. It tests understanding of posteriors, the role of the evidence term, log-space scoring, optimality under 0-1 loss and how unequal error costs change the decision.

How is Bayes' theorem adapted into a decision rule for classification?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

How is Bayes' theorem adapted into a decision rule for classification? Explain how a classifier such as naive Bayes turns class priors and class-conditional likelihoods into a single predicted label. ```hint Look at the denominator Write out Bayes' theorem for every class and ask which terms actually differ from one class to the next. ``` ### What a Strong Answer Covers - Bayes' theorem for the class posterior and the rule that picks a class from it - Why the evidence term can be dropped - The naive Bayes factorization and why scores are computed in log space - Why the rule is optimal under 0-1 loss, and how it changes when errors have unequal costs ### Follow-up Questions - A feature value never appears with one class in the training data. What happens to the score, and how do you fix it? - The class mix in production differs from the training data. How do you adjust the rule? - Naive Bayes often classifies well but gives poorly calibrated probabilities. Why? - How would you write the decision rule for several classes with a full cost matrix?

Overview: Asks how Bayes' theorem becomes a decision rule that assigns a class label, as in naive Bayes. It tests understanding of posteriors, the role of the evidence term, log-space scoring, optimality under 0-1 loss and how unequal error costs change the decision.

PracHub logo
General
Nov 25, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

How is Bayes' theorem adapted into a decision rule for classification? Explain how a classifier such as naive Bayes turns class priors and class-conditional likelihoods into a single predicted label.

What a Strong Answer Covers Guidance

  • Bayes' theorem for the class posterior and the rule that picks a class from it
  • Why the evidence term can be dropped
  • The naive Bayes factorization and why scores are computed in log space
  • Why the rule is optimal under 0-1 loss, and how it changes when errors have unequal costs

Follow-up Questions Guidance

  • A feature value never appears with one class in the training data. What happens to the score, and how do you fix it?
  • The class mix in production differs from the training data. How do you adjust the rule?
  • Naive Bayes often classifies well but gives poorly calibrated probabilities. Why?
  • How would you write the decision rule for several classes with a full cost matrix?