# Can a decision tree make a decision based on two variables at one split?

I know that the random forest algorithm works by generating a set of decision trees with a subset of features.

Say I was using random forest as a classification algorithm looking at someone's data usage out of a data allowance.

One decision within one of the trees may be if data_usage > 500 branch right else branch left.

My question is: does a decision tree ever make a decision based on two variables at one split?

For example if data_usage > data_allowance branch right else branch left. Or would it be better to encode a new feature data_utilisation as a % usage of their data allowance? So if data_usage > 100 branch right else branch left?

Hope this makes sense,

Thanks.

• My understanding is that what you're describing does not happen in decision trees (at least the standard implementations) - it would take place as successive splits instead of one split. But would this differences in one vs two splits matter very much? – mkt - Reinstate Monica Apr 5 '19 at 13:33
• If it took place in successive splits then it would need a branch for each data allowance and then I guess the classifier would work see a large gain in information when the next feature was data usage with the value being the same as the allowance value. So successive splits makes sense it this case. However this would also require both features in the same subset of features which might not always happen. – Colossal Harry Apr 5 '19 at 13:46

If you do that, you might want to take care to mitigate feature "redundancy", however, I don't have theoretical justification for this claim. In this case, the three features (data_usage / data_allowance, data_usage, data_allowance) are redundant, because the former is a function of the latter two (however, they're not "redundant" when data_usage=0, as all nonzero values of data_allowance yield equivalent values of data_usage / data_allowance).
• In that case, you should just set it to something that indicates it's invalid. Since all are nonnegative numbers, this is easy. Setting it to -1 would work. In python pseudocode: data_utilization = data_usage/data_allowance if data_allowance > 0 else -1. – eqzx Apr 5 '19 at 14:57