필터 지우기
필터 지우기

Control Decision Tree Depth

조회 수: 11 (최근 30일)
Ryan Jones
Ryan Jones 2020년 11월 29일
댓글: Ryan Jones 2021년 1월 22일
MATLAB's function,
fitctree
has name-value arguement to control the maximum number of branch node splits, the minimum leaf size and the minimum parent node size.
I would like to compare two different feature matricies with the same dataset. I want to evaluate the training error and CV error for each model built using the two different feature matrices. However, for a fair compaison, I would like to compute these errors with models of the same tree depth and I can't find a way to specify the number of levels I want the trees to have, nor can I find a pruning method that prunes by tree levels and not by nodes.
Does anyone have any ideas of what I can do? Thanks.

답변 (1개)

Pratyush Roy
Pratyush Roy 2020년 12월 22일
편집: Pratyush Roy 2020년 12월 22일
There is no direct way to set the depth to which we want to grow the tree. This issue has been raised to the concerned people and they might be considered in the future releases of the MATLAB.
EDIT: I have received communication regarding a workaround. For tall arrays, one can use the 'MaxDepth' name-value property for setting the maximum depth to which we want to grow the tree.
The following link might be helpful:
Hope this helps!
  댓글 수: 1
Ryan Jones
Ryan Jones 2021년 1월 22일
Thank you, that is good to know, so I don't keep trying to find methods of fixing the depth.
However, using the method using tall array results in a compact tree and you can't do basic operations such as cross-validation. Plus, I belive it takes longer to build than normal classification trees as it has to evaluate the tall arrays.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by