Naive Bayes Classification for categorical values
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ege
el 25 de Nov. de 2014
Comentada: Ege
el 4 de En. de 2015
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 comentarios
Respuesta aceptada
Sean de Wolski
el 25 de Nov. de 2014
Convert the categoricals to doubles.
c = categorical({'red';'blue';'red'})
double(c)
4 comentarios
Sean de Wolski
el 26 de Nov. de 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).
Más respuestas (0)
Ver también
Categorías
Más información sobre Naive Bayes en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!