Lec-13-Perceptron Vs Bayes Classifier
Lec-13-Perceptron Vs Bayes Classifier
Bayes
Classifier
(Sec 3.10~3.11)
Perceptron vs. Bayes
Classifier
What relationship to the Bayes classifier does the perceptron
bear?
Perceptron is a linear classifier
Bayes classifier is a linear classifier on the assumption of
Gaussianity
Probability distributions
Classification
Say C1
fX(x|C2)
x
H1 H1
Source
x
H2
fX(x|C1)
R c21 p1 c22 p2
H [ p2 ( c12 c22 ) f x ( x | C 2 ) p1(c21 c11 ) f x ( x | C1 )]dx
1
A
If A is positive, the observation is of Class 2
If A is negative, the observation is of Class 1
Implementation of Bayes
Classifier
Define f ( x | C1 )
( x) x Likelihood ratio
f x ( x | C2 )
p (c c )
( x ) 2 12 22 Threshold
p1(c21 c11 )
Assign x to class C1
(x) if (x) > .
x Likelihood ratio Comparator
Otherwise, assign
it to class C2
• Likelihood ratio Computation is completely invariant to the a priori
probabilities and costs involved in the decision-making process.
Another Implementation
Natural logarithm is a monotonic function
Likelihood ratio (x) and Threshold are positive
Assign x to class C1
Log-Likelihood log(x) if log(x) > log.
x Comparator
ratio Otherwise, assign
it to class C2
log
Bayes Classifier for a
Gaussian Distribution (1)
Two-class problem for a Gaussian distribution
E[ X ] 1
Class C1
E[( X 1 )( X 1 )T ] C
Class C2 E[ X ] 2
E[( X 2 )( X 2 )T ] C
1 1
f x ( x | Ci ) exp( ( x i )T C 1( x i )), i 1,2
( 2 )m / 2 (det(C ))1 / 2 2
Bayes Classifier for a
Gaussian Distribution (2)
f ( x | C1 ) p2 (c12 c22 )
( x) x ( x)
f x ( x | C2 ) p1(c21 c11 )
Assumption
two classes are equiprobable: p1=p2=0.5
No cost on correct classification: c11=c22=0 and c21=c12
log 0
log ( x ) log( f x ( x | C1 )) log( f x ( x | C 2 ))
1 1
( x 1 )T C 1( x 1 ) ( x 2 )T C 1( x 2 )
2 2
1
( 1 2 )T C 1 x ( 2T C 1 2 1T C 11 )
2
wT x b Linear Classifier
1-D Gaussian Distribution
Decision boundary
fX(x|C1) fX(x|C2)
1 0 2 x