How to show Sample Size at Each Split in Tree using fitctree?
3 views (last 30 days)
Siddharth Sundar on 31 Oct 2014
If I understand correctly, you want to be able to extract the subset of observations used at each split in a node.
The CutPredictor property ClassificationTree object is what you need.
tree.CutPredictor returns the names of the variables used in each node. You can use this along with the output of the CutPoint property (gives you the values used as cut points in the tree) to generate the subset of observations by using the conditions obtained from the above properties to index into the training data set.