Can someone help to solve and if possible explain my mistake. I have a two numeric matrices for using it in classification tree
x: data matrix <2422x39 double>
y: column vector, class label for each instance <2422x1 double>
I'm doing:
t = classregtree(x, y, 'method','classification');
yPredicted = eval(t, x);
cm = confusionmat(y,yPredicted); // error
Error using ==> confusionmat at 52
G and GHAT need to be the same type.
Tree succesfully built. But I cannot get a confusion matrix for that example
I have read that post to write above code Decision Tree in Matlab
If I use exactly same example from link, its working but when I use my own its not working. Same steps I took for building regression tree ( t = classregtree(x, y) ) and no error in confusionmat() function. Please explain what I'm doing incorrectly.
Thanks in advance