[R] rpart - predict terminal nodes for new observations

tudor tudor_bodea at hotmail.com
Tue May 15 16:30:05 CEST 2012


Dear useRs:

Is there a way I could predict the terminal node associated with a new data
entry in an rpart environment? In the example below, if I had a new data
entry with an AM of 5, I would like to link it to the terminal node 2. My
searches led to http://tolstoy.newcastle.edu.au/R/e4/help/08/07/17702.html
but I do not seem to be able to operationalize Professor Ripley's
suggestions.

Many thanks.

Tudor

> tree.prune
n= 2400 

node), split, n, loss, yval, (yprob)
      * denotes terminal node

1) root 2400 779 0 (0.6754167 0.3245833)  
  2) AM< 6.5 1428 254 0 (0.8221289 0.1778711) *
  3) AM>=6.5 972 447 1 (0.4598765 0.5401235)  
    6) P>=10.39666 390  86 0 (0.7794872 0.2205128) *
    7) P< 10.39666 582 143 1 (0.2457045 0.7542955) *


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



More information about the R-help mailing list