A few questions about the implementation
naroga opened this issue · 2 comments
naroga commented
Hey, I understand most of what you did on Classifier.php
. However, I have a few questions here.
Line 121:
$probability = ((1 * 0.5) + ($totalTokenCount * $probability)) / (1 + $totalTokenCount);
Why are you adding 0.5
to the result of ($totalTokenCount * $probability)
's division by (1 + $totalTokenCount)
?
Great package, thanks!
fieg commented
I think it's best described here: http://burakkanber.com/blog/machine-learning-naive-bayes-1/ (see the paragraph "The Code: Guessing")
naroga commented
Thanks, man.