Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A simple way to estimate the probabilities above is by counting how many times each eventoccurs in the training data. LetNbe the total number of
A simple way to estimate the probabilities above is by counting how many times each eventoccurs in the training data. LetNbe the total number of spam emails,Nthe numberssjof spam emails in which wordjoccurs,Nthe total number of ham emails, andNthehhjnumber of ham emails in which wordjoccurs. We then setNN-NsjssjP(X= 1|Y=S) =,P(X= 0|Y=S) = 1-P(X= 1|Y=S) =,ijiijiijiNNssNN-NhjhhjP(X= 1|Y=H) =,P(X= 0|Y=H) = 1-P(X= 1|Y=H) =.ijiijiijiNNhhWrite Python code to compute these probabilities using data intr
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started