Is the Naive Bayes Classifier implementation in NLTK a bernoulli Naive Bayes or a Multinomial Naive Bayes?

31 views
Skip to first unread message

grak...@ucsc.edu

unread,
Apr 27, 2017, 1:25:09 PM4/27/17
to nltk-users
For the document classification task, I have used boolean features (presence or absence of words) and counts of words, and both seem to work.

I am not clear if the implementation of the Naive Bayes classifier in NLTK is a Bernoulli or a multinomial one.

Can someone help, please?

Alex Rudnick

unread,
Apr 27, 2017, 4:21:47 PM4/27/17
to nltk-...@googlegroups.com
You can take a look at the implementation to see what it's doing; the
code is pretty straightforward, in this case.

Probably your answer is in this function here
https://github.com/nltk/nltk/blob/develop/nltk/classify/naivebayes.py#L90

Hope this helps!
> --
> You received this message because you are subscribed to the Google Groups
> "nltk-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nltk-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
-- alexr
Reply all
Reply to author
Forward
0 new messages