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!