when using matlab command 'fitctree' for classification purpose, and I change the order of the attributes I do not find the same Tree and thus the same classificaiton error? why? CART algorithm does take account on the attributes firstly introduced ?

  • $\begingroup$ If they are ordered because of categorical variable, then yes the semantics matters $\endgroup$
    – Aditya
    May 9 '18 at 17:27

A possible answer.

Check to see if you have nominal variables with more than a reasonable number of levels. If that is the case then a heuristic is applied to select the best split. One such heuristic is to group levels on left to right, and that might affect the order. Anyway, it is reasonable to expect that the order of levels should not affect the output.

See this link for detalied explanation on how this is implemented on matlab matlab documentation.

  • $\begingroup$ I am working with numeric variables and with matlab even if I change the splitting mode I get the same result. My problem is that Matlab takes into account the order of the attributes put in the trainig matrix. Below a simple example mentionning what I mean: load ionosphere % Contains X and Y variables Mdl = fitctree(X,Y) view(Mdl,'mode','graph'); X1=fliplr(X) Mdl1 = fitctree(X1,Y) view(Mdl1,'mode','graph'); you can see that in this case I get different model? I can't really conceive why? $\endgroup$
    – LSola
    Jun 14 '17 at 11:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.