1

why is it when we use fictree for the same training matrix (same features) but with different order, we do not get the same model and thus not the same error of classification ?
example:

if we have x1,x2,x3 as predictor, training matrix M1=[x1,x2,x3] or M2=[x2,x1,x3] and fitctree(M1,Label), fitctree(M2,Label) will not have the same model. why?

nils
  • 338
  • 2
  • 11
LMarwa
  • 41
  • 5
  • You need to show a [mcve] – Ander Biguri May 31 '17 at 13:01
  • you can see the example posted below – LMarwa May 31 '17 at 13:09
  • Nope I cant, Post code in Stackoverflow and for heavens shake, not as images. – Ander Biguri May 31 '17 at 13:17
  • Deleted my answer because it was completely wrong - the tree is actually deterministic, only the cross validation isn't. So the seed has no effect on the tree. Sry for wasting your time. But i'm *very* curious what the cause is, because from a logical standpoint it makes no sense to me. `fitctree` uses CART which always takes the feature that increases the impurity the most. Also, in other languages the order apparently does NOT play a role even tough they also use CART, e.g. https://stackoverflow.com/questions/43941163/does-feature-order-impact-decision-tree-algorithm-in-sklearn – Leander Moesinger May 31 '17 at 15:18
  • ok thank you for your answer :) no problem – LMarwa May 31 '17 at 15:29

0 Answers0