Search code examples
algorithmmachine-learningcomputer-sciencedecision-treetheory

Reusing a feature to split regression decision tree's nodes


I was left with a little question by the end of a video I've watched about regression tree algorithm: when some feature of the dataset has the threshold with the lower value for the sum of squared residuals, than it is used to split the node (if the number of observations in the node is greater than some predefined value). But can this same feature be used once again to split a node of this branch of the tree? Or the following splits of this branch have to be splitted by thresholds defined by other features (even if the feature that has already splitted other node has a threshold with the lower value for the sum of squared residuals of the observations of this node)?

Furthermore, I've got the same doubt when studying decision tree classifier: if a feature that has already been used in this branch can split the observations of some node with the lower value for gini's impurity compared to the splits that other features could make, than is this "already used" feature allowed to perform the split or not?

Thanks in advance for the attention!


Solution

  • It's important to remember what data is associated with any node in the tree. Suppose I split my root node on feature x1, where the left child has x1=0 and the right child has x1=1. Then everything in the left subtree will have x1=0. It doesn't make sense to split on x1 anymore - all the data has the same x1 value!