- Determine the variable used to split the data at the node from CutPredictor (if not a leaf node).
- Determine whether that variable is continuous or categorical from CutType. If it is continuous, then use CutPoint to determine the threshold used to split the data at that node. Otherwise, use CutCategories.
- Examine Parent to determine which nodes have the current node as its parent.
- Determine the subsets of the observations that fall on either side of the threshold
- Retaining these subsets of observations, repeat these steps for each of the children nodes
Retrieving data points in a CART tree node (statistics and machine learning toolbox)
3 ビュー (過去 30 日間)
古いコメントを表示
I would like to obtain the row indices of the predictor matrix X that are returned in the tree.NodeSize variable. I'm looking for something similar to the CutPredictor, but in the first dimension of X. Thanks.
0 件のコメント
回答 (1 件)
Sarah Mohamed
2017 年 9 月 15 日
There doesn’t appear to be built-in functionality for this already, but it is possible to traverse the tree to retrieve these observations using the properties Parent, CutPredictor, CutType, CutPoint, and/or CutCategories. The steps would be somewhat like the following:
Starting from the root node (node 0),
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with Statistics and Machine Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!