Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The table shows the examples of SPAM and those of HAM messages which are consist

ID: 3838265 • Letter: T

Question

The table shows the examples of SPAM and those of HAM messages which are consisted of some words

whose dictionary size is twelve. Suppose that you’ve received SPAM messages for the 1st 3 days, then

HAM messages for the next 5 days, i.e. a data as a sequence of message is <Spam, Spam, Spam, Ham,

Ham, Ham, Ham, Ham >.

1. Compute the the maximum likelihood of SPAM, i.e. P(SPAM)=q, using a log-likelihood.

2. In the Bayes net of this ML parameter learning, (a) how many parameters are required?

(b) Draw the BN with the CPT of the required parameters (e.g. q q q , …..). -- You don’t yet have to compute the exact values of parameters.

3. By ML-learning, compute a parameter value, P(“secret” | SPAM) and P(“secret” | HAM), respectively.

4. Now, the new message “golf” is received. Compute the likelihood of this message is SPAM.

5. The new message “secret is secret” is received. What is the likelihood of this message is SPAM?

6. For a new message, “tomorrow is secret”, what is the likelihood of this message is SPAM and HAM, respectively?

Spam Ham offer is secret Play golf tomorrow click secret link went play golf secret golf link secret golf event golf is toworrow golf cost money

Explanation / Answer

3.

P(SPAM)=3/8 (as there are 3 SPAM messages out of 8 messages)

P(HAM)=5/8(5 HAM messages out of 8 messages).

P("secret"|SPAM)= 3/9 (as the word "secret" occurs three times )=1/3

P("secret"|HAM)= 1/15 (as the word "secret" occurs once in the total of 15 words)

4.

To compute P(SPAM|"golf"):

P(SPAM|"golf)= [P("golf"|SPAM)*P(SPAM)]/P("golf")

=[(1/9)*(3/8)]/6/24

=1/6

5.

To Compute P(SPAM|"secret is secret")=P("secret is secret"|SPAM)*P(SPAM) /P("secret is secret")

numerator:

P("secret is secret" |SPAM)= (3/9 *1/9 * 3/9)

P(SPAM) = 3/8

numerator =1/9*1/9*3/8

Denominator:

P("secret is secret")= (4/24 * 2/24 *4/24)=(1/36*1/12)

therfore answer = (1/9*1/9*3/8)/(1/36*1/12)

6.

P(SPAM|"tomorrow is secret")= P("tomorrow is secret"|Spam)*P(SPAM) / P("tomorrow is secret")

P("tomorrow is secret"|SPAM)= (0/9*1/9*3/9) [ as the word tomorrow doesnot occur in SPAM ] =0

therefore P(SPAM|"tomorrow is secret ")=0

for HAM:

P(HAM|"tomorrow is secret")= P("tomorrow is secret"|HAM)*P(HAM) / P("tomorrow is secret")

P("tomorrow is secret"|HAM)= (2/15*1/15*1/15)

P(HAM)= 5/8

P("tomorrow is secret")= 2/24 * 2/24 * 4/24=1/12 * 1/12* 1/8

therfore answer=0.4266

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote