* Bayes rule is generally intuitive from a graphical point of view
* Divide $P(\text{fries}|\text{time})$ by $P(\text{fries})$
* Then multiply by $P(\text{time})$
* If you forget that, the probabilities will sum > 1
---
## Complicated $\mathcal{D}$
* What if we have more columns in $\mathcal{D}$?
* Perhaps we have observed both fries and ice cream
* Just replace $p(x|y = c,\theta) = \prod\limits_{d=1}^{D}p(x_d|y=c,\theta)$
* Each $d=1$ is fries and $d=2$ is ice cream
* Sounds good?
---
## Independence
* If you remember your course in probability, you are slamming your foot on the brake
* "We can't multiply probabilities unless they are independent!" you say
* Observation are unlikely to be independent
* Sure. But let's assume that they are independent anyway.
* This is the *Naive Bayes* classifier
* Justification? It works well, usually.
---
## Naive Bayes
* See section 9.3 of the book
* The classifier is not *correct*, but experience shows it works well
* Approximation and experience are at the heart of machine learning
* We will look at a more complete example next lecture
---
## ML Details
* We are doing ML, not probability
* So what does that mean?
* Algorithms need to run on computers
* Expect to see approximations and simplifications
---
## Good?
* Naive Bayes can work surprisingly well
* For spam email detection, for example
* Compared to other approaches, this is also lightning fast
* And because this is probability, we can do clever things with priors
* This is important, and we'll go over it in detail next time
---
## Distributions
* We can use Naive Bayes for any distribution
* Although we will generally stick to either Bernoulli or Gaussian
* We can also mix the two together
* E.g., whether or not fries or ice cream are present (Bernoulli), and the number of people already sitting down (Gaussian)
---
## MNIST Digits
* As a preview, we'll apply Naive Bayes on the MNIST digits dataset
* The dataset is filled with 60000 handwritten digits from 0 to 9