[R] rpart returning only 1 node

Ko-Kang Kevin Wang kwan022 at stat.auckland.ac.nz
Mon Mar 10 08:48:03 CET 2003


Hi,

This may actually be a theoretical question.

When I tried to do the following:

##########################################################
> colnames(rating.adclms)
 [1] "usage"    "mileage"  "sex"      "excess"   "ncd"     
 [6] "primage"  "minage"   "drivers"  "district" "cargroup"
[11] "car.age"  "adclms"   "days"    
> rating.r1 <- rpart(adclms ~ ., data = rating.adclms, 
+                                method = "class")
> rating.r1
n= 140602 

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

1) root 140602 3792 0 (9.730303e-01 2.506365e-02 1.834967e-03 
7.112274e-05) *
##########################################################

Should I set the costs in rpart()?  I'm kind of surprised to see it only 
return 1 node for the tree.

-- 
Cheers,

Kevin

------------------------------------------------------------------------------
/* Time is the greatest teacher, unfortunately it kills its students */

--
Ko-Kang Kevin Wang
Master of Science (MSc) Student
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022
Ph: 373-7599
    x88475 (City)
    x88480 (Tamaki)



More information about the R-help mailing list