TTDS Lecture 5
TTDS Lecture 5
TECHNIQUES FOR
DATA SCIENCE
LECTURE 5
Bayesian Classification, Naïve Bayes Classifier
Bayesian Classification: Why?
A statistical classifier: performs probabilistic prediction,
i.e., predicts class membership probabilities
Foundation: Based on Bayes’ Theorem.
Performance: A simple Bayesian classifier, naïve Bayesian
classifier, has comparable performance with decision tree
and selected neural network classifiers
Incremental: Each training example can incrementally
increase/decrease the probability that a hypothesis is
correct — prior knowledge can be combined with observed
data
Standard: Even when Bayesian methods are
computationally intractable, they can provide a standard
of optimal decision making against which other methods
can be measured
Bayes’ Theorem: Basics
M
Total probability Theorem: P(B) P(B | A )P( A )
i i
i 1
needs to be maximized
Naïve Bayes Classifier
standard deviation σ 1
g ( x, , )
2
e 2
2
and P(xk|Ci) is P ( X | C i ) g ( x k , Ci , C i )
Naïve Bayes Classifier: Training Dataset
age income studentcredit_rating
buys_computer
<=30 high no fair no
<=30 high no excellent no
31…40 high no fair yes
>40 medium no fair yes
>40 low yes fair yes
>40 low yes excellent no
31…40 low yes excellent yes
<=30 medium no fair no
<=30 low yes fair yes
>40 medium yes fair yes
<=30 medium yes excellent yes
31…40 medium no excellent yes
31…40 high yes fair yes
7
>40 medium no excellent no
Naïve Bayes Classifier: Comments
Advantages
Easy to implement
Good results obtained in most of the cases
Disadvantages
Assumption: class conditional independence,
therefore loss of accuracy
Practically, dependencies exist among variables
E.g., hospitals: patients: Profile: age, family history, etc.