Summary method for the crtree function
# S3 method for crtree summary(object, prn = TRUE, splits = FALSE, cptab = FALSE, modsum = FALSE, ...)
object | Return value from |
---|---|
prn | Print tree in text form |
splits | Print the tree splitting metrics used |
cptab | Print the cp table |
modsum | Print the model summary |
... | further arguments passed to or from other methods |
See https://radiant-rstats.github.io/docs/model/crtree.html for an example in Radiant
crtree
to generate results
plot.crtree
to plot results
predict.crtree
for prediction
#> Classification tree #> Data : titanic #> Response variable : survived #> Level : Yes in survived #> Explanatory variables: pclass, sex #> Complexity parameter : 0.001 #> Minimum observations : 2 #> Nr obs : 1,043 #> #> node), split, n, loss, yval, (yprob) #> * denotes terminal node #> #> 1) root 1043 425 No (0.40747843 0.59252157) #> 2) sex=female 386 96 Yes (0.75129534 0.24870466) #> 4) pclass=1st,2nd 234 16 Yes (0.93162393 0.06837607) * #> 5) pclass=3rd 152 72 No (0.47368421 0.52631579) * #> 3) sex=male 657 135 No (0.20547945 0.79452055) *#> Regression tree #> Data : diamonds #> Response variable : price #> Explanatory variables: carat, color #> Complexity parameter : 0.001 #> Minimum observations : 2 #> Nr obs : 3,000 #> #> node), split, n, deviance, yval #> * denotes terminal node #> #> 1) root 3000 46955880000 3907.1860 #> 2) carat< 0.985 1935 2372900000 1618.3500 #> 4) carat< 0.645 1392 380268800 1050.3640 #> 8) carat< 0.445 976 53669310 779.0041 * #> 9) carat>=0.445 416 86114590 1687.0170 * #> 5) carat>=0.645 543 392351300 3074.4030 #> 10) carat< 0.835 385 141250000 2743.9140 * #> 11) carat>=0.835 158 106584800 3879.7090 * #> 3) carat>=0.985 1065 16028000000 8065.7750 #> 6) carat< 1.405 715 3304451000 6073.9550 #> 12) color=H,I,J 255 319335200 5102.8240 #> 24) carat< 1.195 168 103927100 4650.5890 * #> 25) carat>=1.195 87 114701700 5976.1030 * #> 13) color=D,E,F,G 460 2611311000 6612.3000 #> 26) carat< 1.125 345 1332882000 6036.3540 #> 52) carat< 1.035 230 591161500 5622.1260 * #> 53) carat>=1.035 115 623327300 6864.8090 * #> 27) carat>=1.125 115 820663700 8340.1390 #> 54) carat< 1.255 85 496929600 7741.9880 * #> 55) carat>=1.255 30 207156000 10034.9000 * #> 7) carat>=1.405 350 4092028000 12134.7800 #> 14) carat< 1.92 222 1737666000 10614.4000 #> 28) color=H,I,J 116 500025900 9294.2070 #> 56) carat< 1.535 68 227988500 8493.4850 * #> 57) carat>=1.535 48 166674200 10428.5600 * #> 29) color=D,E,F,G 106 814213500 12059.1300 * #> 15) carat>=1.92 128 951174900 14771.6900 #> 30) carat< 2.125 80 658765300 14061.3100 #> 60) color=G,I,J 45 316470200 13070.9800 * #> 61) color=D,E,F,H 35 241416700 15334.6000 * #> 31) carat>=2.125 48 184754600 15955.6500 *