Bayes Classifiers Naïve Bayes Classification Patrick Mair
Bayes Classifiers � Weather data set � Predictors: Outlook, Temperature, Humidity, Windy. � Response: Play (yes/no) � Starting point � Cross classification: Predictor/Response Outlook/Play Temperature/Play yes no yes no sunny 2 3 hot 2 2 4 0 4 2 overcast mild 3 2 3 1 rainy cool
Bayes Classifiers � Conditional probabilities � Conditioned on response categories Outlook/Play Temperature/Play Play yes no yes no 2/9 3/5 2/9 2/5 yes no sunny hot … 9/14 5/14 overcast 4/9 0/5 mild 4/9 2/5 3/9 2/5 3/9 1/5 rainy cool 1 1 1 1
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 E H P H ( ) = | P H E ( ) P E � P(H)…prior probability � P(H|E)…posterior probability
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
Recommend
More recommend