Bayes Network
-offer is secret click sports
p(“secret”|spam) = 1/3
Dictionary has words
p(spam) ~ 1
p(wi|spam) ~ 11
p(wi|ham) ~ 11
message m=”sports”
p(spam|m) = 0.1667 or 3/18
= p(m|spam) p(spam) / P(m|spam)p(spam)+(m|ham)p(ham)
m = “secret is secret”
p(spam | m) = 25 /26
laplace smoothing
ml p(x) = count(x)/n
LS(k) p(x) = count(x) + k / (n + k|x|)
1 message 1 spam p(spam) = 2/3
10 message 6 spam p(spam) = 7/12
100 message 60 spam p(spam) = 61/102
k = 1, p(spam) = 2/5 p(ham) = 3/5 p(“today”|spam) = 1/21 p(“today”|ham) = 3/27
M = “today is secret” P(spam|m)= 0.4858
summary naive bayes