Which function should I use to classify an input data into one of ten classes in Statistics Toolbox 7.1 (R2010a)?

2 次查看(过去 30 天)
I have an input data that has two categorical values: hobbies, favorite food. Hobbies can take 50 different values and favorite food can take 12 values. The issue is that I am using CLASSREGTREE and the number of values hobbies can take exceeds the upper bound on the maximum number of values categorical values can take, which is 32. Is CLASSREGTREE a right approach or are there other functions in the Statistics Toolbox suitable for this task?

回答(1 个)

Maurice Boueri
Maurice Boueri 2011-1-19
There are two ways to solve this problem:
1) CLASSREGTREE can be used to solve this classification problem because response values are ordinal. Convert the numerical YFIT output from CLASSREGTREE/EVAL to integer by calling ceil(YFIT)). Note that when many levels in the predictor variables, even when the number of levels, L, is less than 32, calling CLASSREGTREE with 'classification' method would be very slow, because it has to go through all 2^(L-1) possibilities.
2) NaiveBayes can be used as follows:
NB=NaiveBayes.fit([hobbies favFoods],ageGroups, 'dist','mvmn');
C= NB.predict(newData);

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by