Naive Bayes Classification for categorical values
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Sean de Wolski
am 25 Nov. 2014
Convert the categoricals to doubles.
c = categorical({'red';'blue';'red'})
double(c)
4 Kommentare
Sean de Wolski
am 26 Nov. 2014
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).
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Naive Bayes finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!