"C " <firstname.lastname@example.org> wrote in message news:email@example.com... > Hi, I have a question regarding the pruning of decision trees. I > understand that the method used is to minimize the fitting error plus a > penalty on the number of nodes: > > (resubsitution error) + penalty * (number of nodes) > > > My question is, shouldn't the prune function allow us to set what the > penalty weight is here? I don't see this as an option anywhere in the > prune function. > > Thanks in advance. > > > PS: I have seen this related question thread, > > http://www.mathworks.com/matlabcentral/newsreader/view_thread/256011 >
Strictly speaking, the criterion is
(resubsitution error) + penalty * (number of leaves)
You do have this option. Depending on what implementation you are using, do one of: 'help ClassificationTree.prune', 'help RegressionTree.prune' or 'help classregtree.prune'. Look at the 'alpha' parameter. This parameter is what you call the penalty weight. If you are using ClassificationTree or RegressionTree, the cost penalty for the pruning levels is saved in the PruneAlpha property.