What is the Bayes classifier for minimum error rate, and why does picking the most probable class minimise your chance of being wrong?
Supervised learning, Bayes decision theory
Level L1 Beginner. Length Short. Nature Th Theoretical.
What's being asked
Whether you can state the Bayes rule in plain words and explain why choosing the class with the highest probability given the input minimises mistakes.
Key idea
Given an input (such as an email), the Bayes classifier predicts the class with the largest posterior probability — the chance that the true label is after seeing . At that input, the chance of being wrong is , so picking the largest probability leaves the smallest possible chance of a mistake.
Steps
- Define the posterior probability : the probability that an input belongs to class once we have observed (for example, the chance an email is spam given its words).
- Fix one input . If we predict class , we are wrong whenever the true class is not , so the error probability at is .
- To make as small as possible, pick the class with the largest : that is .
- Because this rule gives the smallest chance of error at every single input , it also gives the lowest overall error rate across all inputs. Even this ideal rule still makes mistakes when classes overlap (for instance, an email that looks equally like spam and normal mail); computing the boundary with densities and Bayes' rule comes next.
Common mistakes
- Ignoring how common each class is overall (the prior ) and looking only at how typical the input is for each class (the likelihood ). Looking only at the likelihood works only when all classes are equally common.
- Thinking the Bayes classifier has zero error. If the classes overlap, the Bayes error is above zero and nothing can remove it.
- Forgetting that the rule assumes equal cost for every mistake. With unequal costs the rule changes.
How long your answer should be
4–5 sentences; under 2 minutes.
Read this
Previous in Supervised learning: A fraud dataset has 99.5% legitimate and 0.5% fraudulent transactions, and your classifier reports 99.5% accuracy. Is it a good classifier, and how would you handle the imbalance?
Next in Supervised learning: What is the difference between a generative and a discriminative classifier? What is one example of each, and when would you prefer each?