The maximum a posteriori (MAP) decision rule picks the class with the largest posterior probability. It is the optimal decision rule because it gives the smallest probability of a wrong decision. It is one step of the Bayes Decision and Classifiers topic.

Main idea

Decide $\omega_k=\arg\max_{\omega_i}\,p(\omega_i|x)$. This is the same as $\arg\min_{\omega_i}\,p(e_i|x)$.


Intuition: Decision with Prior Knowledge Only

You see a student in a classroom, but you cannot see the student clearly. You must decide if the student is male () or female ().

SchoolBest decisionError rate
EEE0.70.3 (male)
Accounting0.30.7 (female)

This is the maximum probability decision:

  • decide if , and vice versa
  • the decision can still be wrong, but no other decision is better
  • the opposite decision (decide female in EEE) has an error rate of

Adding Data: Prior and Posterior Probability

Now you know that the student has a height of m. The best decision is still to pick the class with the larger probability. The difference is that the probabilities now include the knowledge of .

Two kinds of probability:

  • prior probability is the probability of class before you know the data value
  • posterior probability is the probability of class after you know the data value in a particular scenario

The rule changes name from maximum probability decision to maximum a posteriori probability decision, or MAP decision.

MAP decision rule:

or, more generally:


Why MAP is Optimal

When you decide from the observed value , the probability that the decision is correct is . The probability of a wrong decision (error rate) is:

Because MAP picks the largest , the error is the smallest. So MAP minimises the probability of decision error:


Calculating the Posterior with Bayes Formula

It is difficult to get directly. It is easier to get the prior and the class-conditional probability .

From the basic rule of probability :

So:

where the mixture PDF or PMF is:

This uses .

Why can be removed:

  • is the probability (density) of a height over all classes
  • it has the same value for all classes, so it does not change which class is the largest

The Challenge: Class-Conditional PDFs for All

To recognise gender automatically for every value of , we need for all possible values of . This is the big challenge.

Each class-conditional distribution must sum or integrate to 1 over all heights (0 m to 3 m here):

The lecture then asks how to simplify the computation. The answer is to convert the decision into a classification with discriminant functions.