0

How can we use Naive Bayes classifier for categorical features? What if some features are numerical?

Gaurav
  • 1
  • 1
  • 2
  • 1
    Possible duplicate of [Where to find a guide to encoding categorical features?](https://stats.stackexchange.com/questions/225395/where-to-find-a-guide-to-encoding-categorical-features) – user5226582 Sep 20 '17 at 09:45

1 Answers1

1

We can use naïve bayes classifier for categorical variables using one-hot encoding. If we have n categories then we create n-1 dummy variables or features and add to our data. If the particular category is associated with a row then we assign it as 1 otherwise 0. If we have some numerical features we can discretize numeric values into few categories. For example we can categorize marks of students in a class as low, medium or high. Other method we can use for this is probability density function where we assume the probability distribution of attribute follows a normal distribution