[R] prune rpart - select option with less splits when 2 cp's are the same

agent dunham crosspide at hotmail.com
Tue Sep 4 13:44:18 CEST 2012


Dear community, 

I want to prune a rpart object and select the one that has 13 splits:

object.rpart$cptable
           CP nsplit rel error    xerror       xstd
1  0.09489173      0 1.0000000 1.0006465 0.05641905
2  0.05053897      1 0.9051083 0.9234187 0.05427033
.
.
.
10 0.01279452     12 0.6435679 0.8415860 0.05140204
11 *0.01188184*     13 0.6307733 0.8325764 0.05164638
12 *0.01188184*     14 0.6188915 0.8253215 0.05062095

However, when I try:
object.rpartv2 <- prune(object.rpart, cp=0.01188184, nsplit=13)

I always obtain the one with nsplit = 14, is there a way to choose the
nsplit=13 one?

Thanks in advance, show crosspide at host.com as user at host.com




--
View this message in context: http://r.789695.n4.nabble.com/prune-rpart-select-option-with-less-splits-when-2-cp-s-are-the-same-tp4642152.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list