Input type in classregtree : proper formatting

1 view (last 30 days)
Hi all,
I want to perform a classification task with the "classregtree" function and my input variables, as well as my target, are all categorical variables. I think i followed instructions from the documentation package but i keep getting the following message :
>> t=classregtree(Pr,Target,'method','classification','categorical','[1 2 3 4 5 6 7 8 9 10 11 12 13 14]');
??? Error using ==> classregtree.classregtree>classregtree.preparedata at 234
X must be a matrix of floating-point numbers.
My input 'Pr' is a 14078 x 14 cell array and "Target" is a 14078 X 1 cell.
What step am i missing here ?
Any suggestions would be appreciated.
Thanks, from Rej.

Accepted Answer

Walter Roberson
Walter Roberson on 2 Jan 2012
The documentation for classregtree says, "X is an n-by-m matrix of predictor values." But you are trying to pass in Pr, a cell array rather than a (numeric) matrix.
Cell arrays are permitted for y, your Target, but only cell arrays of strings.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!