I have a dataset, that consists of three columns, A,B and X.
A and B are the feature columns and X is the target column. They are all numerical values. I am trying to predict which feature contributed to X.
The dataset is as follows
A B X
1 1 0
2 2 1
2 2 1
2 2 1
1 1 0
Features A and B are in direct correlation with our target X. On what basis does the Decision Tree Scikit Learn manage to choose the root node?
I have a case, where it always chooses A
as the root node, instead of B
when B
should be the root node. I am trying to understand how does it do that so I can find a solution for the problem.