Number of leaf nodes used by regression tree
조회 수: 4 (최근 30일)
이전 댓글 표시
Is there any way to know the exact number of leaf nodes in a trained regression tree (fitrtree) or each tree of a regression tree ensemble (fitrensemble)? Understand that hyperparameter optimization allows one to view the MaxNumSplits which give an idea of maximum branch nodes, and hence max number of leaf nodes (which should be MaxNumSplits+1, considering root node being a leaf node, for 0 split). However, the optimal number of branchings used in the trained model may be less than MaxNumSplits. How can we obtain this information from a trained regression tree model?
댓글 수: 0
답변 (1개)
Aditya Patil
2021년 4월 7일
X = rand(100, 4);
y = rand(100, 1);
mdl = fitrtree(X,y);
leaves = sum(~mdl.IsBranchNode);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Classification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!