5
$\begingroup$

My question is about a binary decision tree (binary to integer).

Is there any problem if the conditions defined on a same variable ex. x1? I mean when i define the variables for my tree, can I choose:

if(x1>3)
then  
   if (x1>4)
   then ....
   else
    ....
    end
else
....
end 

as you see my variable is always x1, but the conditions are different. In all binary decision tree that I find on the net the variable changes!

$\endgroup$
1
  • 3
    $\begingroup$ In trees, the program chooses what variables and levels should be used for splits; that's part of the point. If you only included x1 in the model, then it would be the only variable used, but the program would still choose the splits. But if you only have one variable, trees probably aren't needed. $\endgroup$
    – Peter Flom
    Oct 24 '12 at 12:24
6
$\begingroup$

Yes, this is possible and happens frequently. Consider the tree page 4 of this tutorial, you'll see that multiple splits are made on both variables longitude and latitude. At each step of the CART algorithm, all predictors are tried and the best one (the one selected for splitting) is the one that maximizes the decrease in partition impurity (or some other metric), that's it. Then you take your child nodes and you split them again. And you iterate. There is absolutely nothing precluding repeated splits on the same predictor.

full link for the tutorial: http://www.stat.cmu.edu/~cshalizi/350/lectures/22/lecture-22.pdf

$\endgroup$
2
  • $\begingroup$ What about the exact same split (x > 4 for example) on different branches? Or does a split generally not apply to both the yes an no sides of a previous split? $\endgroup$
    – johnDanger
    Sep 23 at 15:53
  • 1
    $\begingroup$ My understanding is that a split can be made based on the exact same criterion multiple times anywhere in the tree. Trees are local models, they are recursively partitioning the space, forgetting about the previous decisions. In a given branch, a new split will be made based on what partitions the data best in the corresponding part of the space, regardless of the criteria that were used to make the previous splits. $\endgroup$
    – Antoine
    Sep 24 at 14:46

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.