Self-made naive bayes solution
This commit is contained in:
parent
dd89b36a5a
commit
34e7730db1
263865
dev-0/out.tsv
263865
dev-0/out.tsv
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,7 @@ for line in sys.stdin:
|
||||
log_prob_skeptic += math.log((skeptic_count[term]+1)/(skeptick_words_total + vocabulary_size))
|
||||
log_prob_paranormal += math.log((paranormal_count[term]+1)/(paranormal_words_total + vocabulary_size))
|
||||
|
||||
if log_prob_skeptic > log_prob_paranormal:
|
||||
print("S")
|
||||
else:
|
||||
print("P")
|
||||
if log_prob_skeptic > log_prob_paranormal:
|
||||
print("S")
|
||||
else:
|
||||
print("P")
|
||||
|
267407
test-A/out.tsv
267407
test-A/out.tsv
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user