[R] rpart - predict terminal nodes for new observations

tudor tudor_bodea at hotmail.com
Fri May 18 16:12:15 CEST 2012


Hi Uwe:

Thanks a lot for your reply.  

I contemplated the use of the predict() function but realized that it could
not return what I needed (i.e., the terminal nodes and not the classes). I
went back to the post of Professor Ripley
(http://tolstoy.newcastle.edu.au/R/e4/help/08/07/17702.html) and did find a
way to get the terminal nodes.  I am showing this approach below in case
other useRs face a similar problem.

Many thanks.

Tudor


nodes  <- rpart:::pred.rpart(tree.prune,rpart:::rpart.matrix(es))
where 
tree.prune is the rpart object and es is the estimation data set.

--
View this message in context: http://r.789695.n4.nabble.com/rpart-predict-terminal-nodes-for-new-observations-tp4630104p4630508.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list