Advanced Machine Learning

08: Bayesian Decision Theory

Schedule (you are here )

# date topic description
124-Aug-2026Introduction
226-Aug-2026Foundations of learningDrop/Add
331-Aug-2026PAC learnabilityHW1
402-Sep-2026Linear learning models
507-Sep-2026Labor Day HolidayHoliday
609-Sep-2026Principal Component AnalysisProject ideas
714-Sep-2026Curse of DimensionalityHW2, HW1 due
816-Sep-2026Bayesian Decision Theory
921-Sep-2026Parameter estimation: MLE
1023-Sep-2026Parameter estimation: MAP & NBfinalize teams
1128-Sep-2026Logistic RegressionHW3, HW2 due
1230-Sep-2026Kernel Density Estimation
1305-Oct-2026Support Vector Machines
1407-Oct-2026Matrix Factorization
1512-Oct-2026* MidtermExam, HW3 due
1614-Oct-2026k-means clustering
1719-Oct-2026Invited: Intro to Causal Learning I
# date topic description
1821-Oct-2026Invited: Intro to Causal Learning II
1926-Oct-2026* Mid-point projects checkpointHW4, P
2028-Oct-2026Expectation Maximization
2102-Nov-2026Stochastic Gradient Descent
2204-Nov-2026Automatic Differentiation
2309-Nov-2026Nonlinear embedding approachesHW5, HW4 due
2411-Nov-2026Model comparison & calibration
2516-Nov-2026Convolutional Neural Networks
2618-Nov-2026Word Embedding
2723-Nov-2026Thanksgiving BreakHoliday
2825-Nov-2026Thanksgiving BreakHoliday
2930-Nov-2026* Final ExamExam
3002-Dec-2026Project Final PresentationsHW5 due, P
3107-Dec-2026No classClasses End
3216-Dec-2026Project Reportsdue
3317-Dec-2026Grades due 5 p.m.PAWS

Outline for the lecture

  • Preliminaries
  • The Bayesian View

Preliminaries

Probability theory is nothing but common sense reduced to calculation
- Pierre-Simon Laplace, 1812

Deductive and plausible reasoning

Random Variables

Probability Distributions

Probability Distributions

The Bayesian view

Bayesian decision theory

Definition: Quantify the trade-offs between various classification decisions based on probabilities and the costs that accompany such decisions
Assumptions:
  • The decision problem is posed in probabilistic terms
  • All relevant probability values are known

The Prior

  • $\omega$ is a random variable: fish type
  • $\omega\in \{\omega_1, \omega_2\}$ $\omega_1$ - salmon, $\omega_2$ - sea bass
  • $\prob{P}{\omega_1}$ - the a priory probability (prior) that fish is a salmon
  • $\prob{P}{\omega_2}$ - the a priory probability (prior) that fish is a sea bass
  • Gives us the knowledge of how likely we are to get salmon before we see any fish

Priors-only decision rule

How do we make a decision between $\omega_1$ and $\omega_2$ if all we know is the priors $\prob{P}{\omega_1}$ and $\prob{P}{\omega_2}$?
  • decide if
    salmon $\prob{P}{\omega_1} \gt \prob{P}{\omega_2}$
    sea bass $\prob{P}{\omega_1} \lt \prob{P}{\omega_2}$
  • Thus minimize your probability of being incorrect

$\prob{P}{\mbox{meet}} \gt \prob{P}{\overline{\mbox{meet}}}\rightarrow\mbox{shoot}$

holistic assassin

Decide based just on the prior

  • If $\prob{P}{\omega_1} \gg \prob{P}{\omega_2}$, you are right most of the time when deciding $\omega_1$
  • If $\prob{P}{\omega_1} = \prob{P}{\omega_2}$, you are taking a random guess when deciding $\omega_1$
  • No other decision rule can yield larger (expected) probability of being right

Use observations to increase our chances

  • If we know the class conditional probability density $\prob{P}{\vec{x}|\omega_i}$ we can make better decisions
  • For example, $\vec{x}$ is the observed lightness of a fish
likelihood
rev. Bayes
Thomas Bayes

Bayes theorem

  • Use the observed feature(s) $\vec{x}$ and the Bayes theorem
    \[ \prob{P}{\omega_i|\vec{x}} = \frac{\prob{P}{\vec{x}|\omega_i}\prob{P}{\omega_i}}{\prob{P}{\vec{x}}} \]
  • In "plain English"
    \[ \mbox{posterior} = \frac{\mbox{likelihood}\times\mbox{prior}}{\mbox{evidence}} \]
  • Evidence for $C$ classes $ \prob{P}{\vec{x}} = \sum_i^C\prob{P}{\vec{x}|\omega_i}\prob{P}{\omega_i} $
\[ \prob{P}{\omega_i|\vec{x}} = \frac{\prob{P}{\vec{x}|\omega_i}\prob{P}{\omega_i}}{\prob{P}{\vec{x}}} \]

Put this to numbers

One person in 200,000 has a particular Progressive multifocal leukoencephalopathy (PML). There is a diagnostic test for the disease. It is correct 99% of time. Your test is positive what's the probability you have PML?
  • $\vec{x}$ - tested positively
  • $\prob{P}{+|PML} = 0.99$
  • $\prob{P}{+|\overline{PML}} = 0.01$
  • $\prob{P}{PML} = \frac{1}{200,000}$
  • $\prob{P}{\overline{PML}} = \frac{199999}{200,000}$
  • $\prob{P}{PML|+} \approx 0.05\%$
\begin{align} \prob{P}{+} & = \prob{P}{+|PML}\prob{P}{PML}\\ & + \prob{P}{+|\overline{PML}}\prob{P}{\overline{PML}}\\ \prob{P}{PML|+} &= \frac{\prob{P}{+|PML}\prob{P}{PML}}{\prob{P}{+}} \end{align}

Decide based on posterior

  • If $\prob{P}{\omega_1|\vec{x}} \gt \prob{P}{\omega_2|\vec{x}}$, decide $\omega_1$
  • If $\prob{P}{\omega_1|\vec{x}} \lt \prob{P}{\omega_2|\vec{x}}$, decide $\omega_2$
  • $\prob{P}{error|\vec{x}} = \min[\prob{P}{\omega_1|\vec{x}}, \prob{P}{\omega_2|\vec{x}}]$
posterior

General Bayesian Decision Theory

  • Multiple features in $\vec{x}$
  • More than two states of nature (classes)
  • Allow actions (also refusal to act)
  • Loss function more general that probability of error

General Bayesian Decision Theory: formally

  • $\Omega = \{ \omega_1, \omega_2, \dots, \omega_C\}$ $c$ categories
  • $\vec{x} = \{x_1, x_2, \dots, x_d\}$ $d$-dimensional feature vector
  • $\vec{\alpha} = \{\alpha_1, \alpha_2, \dots, \alpha_A\}$ set of actions
  • $\lambda(\alpha_i|\omega_i)$ loss incurred for taking action $\alpha_i$ in case of $\omega_i$
  • Conditional risk \begin{array} \prob{R}{\alpha_i|\vec{x}} = \sum_j^C \lambda(\alpha_i|\omega_j)\prob{P}{\omega_j|\vec{x}} \end{array}
  • Total risk \begin{array} \prob{R}{\vec{x}} = \sum_i^A \prob{R}{\alpha_i|\vec{x}} \end{array}
\[ \prob{N}{\mu, \sigma} = \frac{1}{\sigma\sqrt{2\pi}} e^{ -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2 } \]

Assignment

Draw probability densities and find the decision regions for the following classes:
  • $\Omega = \{ \omega_1, \omega_2\}$
  • $\prob{P}{x|\omega_1} \sim \prob{N}{20, 4}$
  • $\prob{P}{x|\omega_2} \sim \prob{N}{15, 2}$
  • $\prob{P}{\omega_1} = \frac{1}{3}$
  • $\prob{P}{\omega_2} = \frac{2}{3}$
  • Classify $x = 17$

Maximum A Posteriori

The poor man's Bayes

beta $n = \alpha_H + \alpha_T$ increases $\rightarrow$
  • Potentially, can know all there's to know about posterior
  • But chose to go for a single parameter estimate

Can estimate full distributions

need to resort to sampling

sampling

Choosing conjugate priors

striving for simple analytical forms

Dirichlet