can "splitting attribute" appear many times in decision tree?

yvetterowe picture yvetterowe · Nov 15, 2013 · Viewed 9.1k times · Source

Just want to clarify one thing: the same attribute can appear in decision tree for many times as long as they are in different "branches" right?

Answer

Has QUIT--Anony-Mousse picture Has QUIT--Anony-Mousse · Nov 15, 2013

For obvious reasons, it does not make sense to use the same decision within the same branch.

On different branches, this reasoning obviously does not hold.

Consider the classic XOR(x,y) problem. You can solve it with a two layer decision tree, but you will need to split on the same attribute in both branches.

If x is true:
    If y is true:  return false
    If y is false: return true
If x is false:
    If y is true:  return true
    If y is false: return false

Another example is the following: assume your data is positive in x=[0;1], and negative outside. A good tree would be the following:

If x > 1:      return negative
If x <= 1:
    If x >= 0: return positive
    If x < 0:  return negative

It's not the same decision, so it can make sense to use x twice.