--- 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.
Get (feature, threshold) from Output of rpart() for Stump Tree
2 messages · Terry Therneau, Tim
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090508/2fb1520d/attachment-0001.pl>