Can't prune tree?

4 次查看(过去 30 天)
Ruben
Ruben 2014-10-21
评论: Ilya 2014-10-22
Hello.
When i execute this code:
treetraining = fitctree(X(d.training,:),classNames(y(d.training,:)+1),'SplitCriterion','gdi','PredictorNames',attributeNames,'Prune','off','MergeLeaves','off','MinParent',100)
There is nothing wrong and I get a nice tree. When I execute this code after (or any argument in prune):
tree2 = prune(treetraining);
I get an error:
Error using subsindex
Function 'subsindex' is not defined for values of class 'ClassificationTree'.
I am doing the same thing the help page of prune did in the example. What am I doing wrong?
  1 个评论
Ilya
Ilya 2014-10-22
Could you type
ver
which fitctree
class(treetraining)
which ClassificationTree
which prune
in your MATLAB session and post what you get here.

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by