14
$\begingroup$

Since the decision tree algorithm split on an attribute at every step, the maximum depth of a decision tree is equal to the number of attributes of the data. Is this correct?

$\endgroup$
27
$\begingroup$

No, because the data can be split on the same attribute multiple times. And this characteristic of decision trees is important because it allows them to capture nonlinearities in individual attributes.

Edit: In support of the point above, here's the first regression tree I created. Note that volatile acidity and alcohol appear multiple times:

enter image description here

$\endgroup$
  • 4
    $\begingroup$ Don't get why you were downvoted, but I balanced it again (+1) ;) $\endgroup$ – Firebug May 18 '18 at 11:27
  • 1
    $\begingroup$ I am a strong believer, that downvotes sometimes happen randomly by chance, independent of the quality of a post. We just need to get used to it and not waste our time thinking too much about singular downvotes. $\endgroup$ – Bernhard May 18 '18 at 13:46
  • 5
    $\begingroup$ @mkt if you feel like editing again you can add that typically a decision tree stops creating new branches when wither a pre-specified purity level is reached, a node has less than a specified number of elements, or a split of a node would lead to a new node with less than a specified number of elements. These reasons can easily lead to an attribute not being used at all. $\endgroup$ – aginensky May 18 '18 at 13:47
  • 1
    $\begingroup$ +1, but this plot does leave something to be desired. Which branch represents yes, eg? It might help to post the dataset & code, if that's doable. $\endgroup$ – gung - Reinstate Monica May 18 '18 at 14:05
  • 4
    $\begingroup$ What I mean is, suppose alcohol = 10.50 (ie, alcohol < 10.53), do you then proceed down the right or left branch of the tree? $\endgroup$ – gung - Reinstate Monica May 18 '18 at 14:35

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.