Can't prune tree?
5 views (last 30 days)
Show older comments
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 Comment
Ilya
on 22 Oct 2014
Could you type
ver
which fitctree
class(treetraining)
which ClassificationTree
which prune
in your MATLAB session and post what you get here.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!