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?
x
andy
vary a lot in my case, so the result ofx - y
wouldn't be so helpful, rather the fact thatx 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. $\endgroup$