11619 - SPAM! (or not)
Posted: Sun Jun 16, 2013 12:11 pm
Hello everybody,
I'm struggling to solve problem 11619.
I have coded it in Java, but I have a problem because I'm still getting WA.
Approach:
- use logarithm to calculate big formula
- assign probability spam/ham words (wordSpamFreq/totalSpamWords) or (wordFreqHam/totalHamWords).
Sample input:
MESSAGE SPAM
replica rolex
==
MESSAGE SPAM
replica rolex
==
P(replica/S) = 2/2 (it appears 2 times in 2 spam messages)
P(rolex/S) = 2/2
of course P(replica/H) = 0 & P(rolex/H) = 0.
I've also tried to assign P(replica/S) = 1, P (replica/H) = 0 but also not worked.
For sample input I'm getting this probabilities:
0.5
Unsure
0.9994837377387712
Spam
0.0019912881144990694
Ham
Any suggestion is helpful!
Thanks!
I'm struggling to solve problem 11619.
I have coded it in Java, but I have a problem because I'm still getting WA.
Approach:
- use logarithm to calculate big formula
- assign probability spam/ham words (wordSpamFreq/totalSpamWords) or (wordFreqHam/totalHamWords).
Sample input:
MESSAGE SPAM
replica rolex
==
MESSAGE SPAM
replica rolex
==
P(replica/S) = 2/2 (it appears 2 times in 2 spam messages)
P(rolex/S) = 2/2
of course P(replica/H) = 0 & P(rolex/H) = 0.
I've also tried to assign P(replica/S) = 1, P (replica/H) = 0 but also not worked.
For sample input I'm getting this probabilities:
0.5
Unsure
0.9994837377387712
Spam
0.0019912881144990694
Ham
Any suggestion is helpful!
Thanks!