Screen Link:
https://app.dataquest.io/m/27/naive-bayes-for-sentiment-analysis/4/making-predictions-about-review-classifications
My Code:
prediction *= ((counts.get(word, 0) + 1) / (sum(counts.values()) + class_count))
What I expected to happen:
I expected this
prediction *= ((counts.get(word, 0) + 1) / (sum(counts.values()) + class_count))
What actually happened:
prediction *= text_counts.get(word) * ((counts.get(word, 0) + 1) / (sum(counts.values()) + class_count))
Why the probability was multiplied with text_counts.get(word) ?
Need some help to understand this.