问题
If the input to any node of tree is the shown data, what will be the best split? Any split will have lesser children's accuracy than parent's accuracy, right? So even accuracy is decreasing will we go on splitting?
回答1:
Without getting the specific data, this is hard to answer
But simulating a similiar data can give the rough idea. Here's a tree for such data with max_depth
of 3
The first split takes all the white dots on the right, and classifies them.
The second split takes all the white dots to the left, and classifies the,.
The third splits tries to split between the black points and the white points in the middle, by spliting across the y (X[1]
) axis
For the first split, notice that total gini is now 0.448*1512/2000 + 0.0 * 488/2000 =0.34<0.5
. The accuracy after that split is about 75%
, because it is right on 100%
of 25%
of the data, and 66%
on 75%
of the data.
来源:https://stackoverflow.com/questions/61364693/splitting-in-decision-tree