Self-made naive bayes solution

This commit is contained in:
Łukasz Szymula 2020-03-21 19:36:14 +01:00
parent dd89b36a5a
commit 34e7730db1
3 changed files with 4623 additions and 526657 deletions

263865
dev-0/out.tsv

File diff suppressed because it is too large Load Diff

View File

@ -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")

File diff suppressed because it is too large Load Diff