1
$\begingroup$

How do i use Naive Bayes Classifier (Using sklearn) for a Dataset considering that my feature set is categorical, ie more than 2 categories per feature are present.

  1. I've looked everywhere, some people have used GaussianNB even though the data is categorical (1,2...8)

https://www.google.com/url?q=https://blog.sicara.com/naive-bayes-classifier-sklearn-python-example-tips-42d100429e44&sa=D&source=hangouts&ust=1567686518476000&usg=AFQjCNGORHakHbk2ZntzNZ1wsTYG6QUhig

  1. Some people recommend converting it to One-Hot encoding and then using BernoulliNB which doesn't make sense to me because then the newly created features would have a high correlation which is against one of the core assumptions of Naive Bayes. (For example color feature has 3 values - Blue, Green, Red and we create 3 features out of it; then if Blue is 1 then its obvious that Red and Green will be 0. Hence the dependency)

  2. Some people recommend using MultinomialNB which according to me doesn't make sense because it considers feature values to be frequency counts.

Can someone point me in the right direction?

$\endgroup$
  • $\begingroup$ Where is the problem with MultinominalNB? I don‘t see why it shouldn‘t work... $\endgroup$ – Peter Sep 5 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.