3 ms·
In response to some of the comments: In my experience, all variables are important, but on testing, using only the ones (i.e., the words) observed in the text
by atrilla 15y ago
In response to some of the comments:
In my experience, all variables are important, but on testing, using only the ones (i.e., the words) observed in the text to test yields the best effectiveness rates, following the implementation from Manning, Raghavan and Schütze (2008).
In addition, the considered Laplace smoothing is of utmost importance to deal with out-of-vocabulary words, thus avoiding the annoying 0's.
My implementation:
https://github.com/atrilla/nlptools/blob/master/core/classification/MultinomialNaiveBayes.php https://github.com/atrilla/nlptools/blob/master/core/classif...