I need a little help with Exercise 10. Maybe I am wrong on my formula for likelihood_word_given_spam, and likelihood_word_given_ham. I thought it would be the cumulative product of spam (respectively ham) times the probability of spam (respectively ham). I think I got it wrong.
Thank you for your reply. I tried what you suggested, but I did not pass the test for exercise 10. Maybe I got something wrong somewhere else then. Here is my code for this part.
{moderator edit: code removed}
For cumulative product, I think it is correct since I am computing the probability of a word given it is a spam (resp ham)…