Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Pruning in decision trees - how to set penalty
Replies: 1   Last Post: Jan 25, 2013 4:27 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Ilya Narsky

Posts: 133
Registered: 11/7/08
Re: Pruning in decision trees - how to set penalty
Posted: Jan 25, 2013 4:27 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"C " <calvin.price@aexp.com> wrote in message
news:kdua0k$nmu$1@newscl01ah.mathworks.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.

-Ilya




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.