Naive Bayes Classification for categorical values
1 次查看(过去 30 天)
显示 更早的评论
Hi, I have a dataset containing numerical and categorical data. I like to use Naive Bayes Classifier in the following link but it only confers with numerical values.
Does anyone have an idea about how to extend that code to categorical data as well?
0 个评论
采纳的回答
Sean de Wolski
2014-11-25
Convert the categoricals to doubles.
c = categorical({'red';'blue';'red'})
double(c)
4 个评论
Sean de Wolski
2014-11-26
The table is nice for storing but not for these computations. Reconvert to a table after with the same names from the original table (T.properties.variableNames).
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Naive Bayes 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!