--- begin included message --
Hi, 
I have a question regarding how to get some partial information
from the output of rpart, which could be used as the first argument to
predict. For example, in my code, I try to learn a stump tree (decision
tree of depth 2):

   "fit        <- rpart(y~bx, weights = w/mean(w), control = cntrl)

--- end inclusion ---

 1. For stump trees, you can use the depth option in rpart.control to get a 
small tree.  You also might want to set maxsurrogate=0 for speed.
 
 2. Try help(rpart.object) for more information on what is contained in the 
returned rpart object.  In your case fit$splits[1,] would contain all that you 
need.
 
        Terry T.
        

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to