Naïve ¡Bayes ¡Classifica/on ¡
Debapriyo Majumdar Data Mining – Fall 2014 Indian Statistical Institute Kolkata
August 14, 2014
Bayes Theorem Thomas Bayes (1701-1761) Simple form of Bayes - - PowerPoint PPT Presentation
Nave Bayes Classifica/on Debapriyo Majumdar Data Mining Fall 2014 Indian Statistical Institute Kolkata August 14, 2014 Bayes Theorem Thomas Bayes (1701-1761) Simple form of Bayes Theorem, for two
August 14, 2014
2 ¡
Class ¡prior ¡ probability ¡ Predictor ¡prior ¡ probability ¡or ¡ evidence ¡ Posterior ¡ probability ¡ Likelihood ¡
3 ¡
The ¡values ¡of ¡the ¡ features ¡are ¡given ¡
4 ¡
P(A, B) = P(A)× P(B | A)
5 ¡
6 ¡
Known ¡values: ¡ constant ¡ Class ¡posterior ¡ probability ¡
7 ¡
c
i=1 n
Approximated ¡ from ¡rela/ve ¡ frequencies ¡in ¡ the ¡training ¡set ¡ Approximated ¡ from ¡frequency ¡in ¡ the ¡training ¡set ¡ The ¡values ¡of ¡ features ¡are ¡ known ¡for ¡the ¡ new ¡observa/on ¡
Example of Naïve Bayes Reference: The IR Book by Raghavan et al, Chapter 6
8 ¡
9 ¡
10 ¡
k=1 nd
11 ¡
k=1 nd
c∈C
k=1 nd
Term ¡weight ¡of ¡tk ¡ in ¡class ¡c ¡
12 ¡
#of ¡documents ¡labeled ¡as ¡ class ¡c ¡in ¡training ¡data ¡ total ¡#of ¡documents ¡in ¡ training ¡data ¡
t'∈V
total ¡#of ¡occurrences ¡of ¡all ¡ terms ¡in ¡documents ¡d ¡∈ ¡c ¡ total ¡#of ¡occurrences ¡of ¡ t ¡in ¡documents ¡d ¡∈ ¡c ¡
13 ¡
t'∈V
t'∈V
14 ¡
India ¡ India ¡ India ¡ UK ¡
Classify ¡
15 ¡
i=1 n
Xi = 1 if ti is present 0 otherwise Absence ¡of ¡terms ¡
16 ¡
India ¡ India ¡ India ¡ UK ¡
Classify ¡
17 ¡
X1= ¡ London ¡ X2= ¡ India ¡ X3= ¡ Embassy ¡
Mul/nomial ¡model ¡
– Takes values as terms of the vocabulary
18 ¡
Bernoulli ¡model ¡
Ulondon=1 ¡ UIndia=1 ¡ UEmbassy=1 ¡
UTajMahal=0 ¡ Udelhi=0 ¡
Ugoa=0 ¡
19 ¡
20 ¡