[R] gbm package: relationship between interaction.depth and number of features?

Tim Converse converse at powerset.com
Mon Feb 2 03:35:04 CET 2009


I'm puzzled by the interaction.depth argument to the gbm() function, and
whether it specifies just the tree depth, or also (implicitly) the number of
distinct features used in splits.

>From some version of the documentation I have:

"interaction.depth     The maximum depth of variable interactions. 1 implies
an additive model, 2 implies a model with up to 2-way interactions, etc."

In practice it seems that an interaction.depth of 2 produces trees of depth
2 (i.e. four terminal leaves), but we have never seen any such trees using
more than two features, even though there are three non-leaf nodes available
to split on.  

Is it possible for gbm to produce a depth-two tree using three distinct
features (at the root, the left subtree, and right subtree)?  Or does the
algorithm impose a constraint that all splits at a given depth must be on
the same feature?

thanks,
  Tim




More information about the R-help mailing list