Bayes Classifiers Nave Bayes Classification Patrick Mair Bayes - - PowerPoint PPT Presentation
Bayes Classifiers Nave Bayes Classification Patrick Mair Bayes - - PowerPoint PPT Presentation
Bayes Classifiers Nave Bayes Classification Patrick Mair Bayes Classifiers Weather data set Predictors: Outlook, Temperature, Humidity, Windy. Response: Play (yes/no) Starting point Cross classification: Predictor/Response
Bayes Classifiers
Weather data set
Predictors: Outlook, Temperature, Humidity, Windy. Response: Play (yes/no)
Starting point
Cross classification: Predictor/Response
yes no sunny 2 3
- vercast
4 rainy 3 2 yes no hot 2 2 mild 4 2 cool 3 1
Outlook/Play Temperature/Play
Bayes Classifiers
Conditional probabilities
Conditioned on response categories
yes no sunny 2/9 3/5
- vercast
4/9 0/5 rainy 3/9 2/5 1 1 yes no hot 2/9 2/5 mild 4/9 2/5 cool 3/9 1/5 1 1
Outlook/Play Temperature/Play … Play
yes no 9/14 5/14
Bayes Classifiers
A new day, prediction “yes”; “no”
Outlook: sunny (p = 2/9; 3/5) Temperature: cool (p = 3/9; 1/5) Humidity: high (p = 3/9; 4/5) Windy: true (p = 3/9; 3/5) Play: ? (p = 9/14; 5/14)
Likelihood of yes/no Normalization
Bayes Classifiers
Bayes’ rule:
H: Hypothesis; e.g. play = yes. E: Evidence that bears on H; i.e. predictor combination. P(H|E)=? P(H)…prior probability P(H|E)…posterior probability
( ) ( ) ( ) ( )
| | P E H P H P H E P E =
Bayes Classifiers
Naïve Bayes
Based on Bayes’ rule Naïvely assumes independence in P(E|H)
Remarks
Calculation of P(E) not needed due to
normalization
No problem in handling missing values Normality assumption on numeric attributes