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 x (such as an email), the Bayes classifier predicts the class Ck with the largest posterior probability P(Ck∣x) — the chance that the true label is Ck after seeing x. At that input, the chance of being wrong is 1−P(Ck∣x), so picking the largest probability leaves the smallest possible chance of a mistake.

Steps

  1. Define the posterior probability P(Ck∣x): the probability that an input x belongs to class Ck once we have observed x (for example, the chance an email is spam given its words).
  2. Fix one input x. If we predict class j, we are wrong whenever the true class is not j, so the error probability at x is 1−P(Cj∣x).
  3. To make 1−P(Cj∣x) as small as possible, pick the class j with the largest P(Cj∣x): that is y^(x)=arg⁡max⁡kP(Ck∣x).
  4. Because this rule gives the smallest chance of error at every single input x, 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

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?