# I am looking for a variant of the classic decision-tree algorithm

The classic decision-tree algorithm would split a branch based on the value of a variable versus a number. For example, if x > 0.5: branch_left; else: branch_right. What I need is a decision-tree-like algo able to split the branches also by comparing a variable with another variable (both features), for example if x > y: branch_left; else: branch_right. I have looked into the various implementation of the decision-tree and random-forest algos (mostly in Python) and I couldn't find any able to do as much.

Do you know if such an algorithm exists already? Can you suggest one I could try?

• Would constructing linear combinations of variables suffice? For you example, you could derive a feature like $x - y$ and find a cut point for that difference. – Fato39 Sep 7 at 11:58
• x and y vary a lot in my case, so the result of x - y wouldn't be so helpful, rather the fact that x is greater or lower than y would help. Of course, I could do the computation in advance and then just make an extra feature column in the dataset to output the result of the comparison. I would prefer to find an algorithm that does that automatically though since the combination of variables could be quite large. – alec_djinn Sep 7 at 12:08