How to show Sample Size at Each Split in Tree using fitctree?
조회 수: 2 (최근 30일)
이전 댓글 표시
Am using fitctree, and of course, altering the MinLeaf size changes the tree output drastically, but also interested in seeing how the sample size shrinks as the tree progresses.
Know how?
thanks! Justin
댓글 수: 0
답변 (1개)
Siddharth Sundar
2014년 10월 31일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Classification Trees에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!