Can't prune tree?

5 views (last 30 days)
Ruben
Ruben on 21 Oct 2014
Commented: Ilya on 22 Oct 2014
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
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.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!