0
$\begingroup$

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

$\endgroup$
1
$\begingroup$

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

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.