How to find the optimal tree size when building a decision tree?
4 次查看(过去 30 天)
显示 更早的评论
I need to categorize a set of data and want to use the CART algorithm for this purpose. In the litterature the importance of finding the right tree size as a trade-off between classification accuracy and overfitting is stressed, so I am wondering whether the tree suggested by the matlab function classregtree corresponds to the max tree or is already an optimized version? If matlab already optimizes the depth of the tree, what is this optimization based on? Otherwise I was thinking of using crossvalidation for my tree and compare the reulting maxtrees for different samples.. Is there a recommended value for minparent? My dataset is quite small so I assume I have to use a value lower than the default in order to generate a reasonable tree...
Many thanks for your help!
0 个评论
回答(1 个)
Ilya
2012-5-21
Grow a deep tree by setting minparent to 1, find the optimal pruning level using
and then prune the tree to the desired level using
Also, may I suggest that you either accept answers to your questions or explain why they do not satisfy you.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!