Naive Bayes Classification for categorical values
2 ビュー (過去 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!