

printcp(rpart)                               R Documentation

_D_i_s_p_l_a_y_s _C_P _t_a_b_l_e _f_o_r _F_i_t_t_e_d _R_p_a_r_t _O_b_j_e_c_t

_U_s_a_g_e_:

     printcp(x, digits=.Options$digits - 2)

_A_r_g_u_m_e_n_t_s_:

       x: fitted model object of class `rpart'.  This is
          assumed to be the result of some function that
          produces an object with the same named components
          as that returned by the `rpart' function.

  digits: the number of digits of numbers to print.

_D_e_t_a_i_l_s_:

     Prints a table of optimal prunings based on a complex-
     ity parameter.

_S_e_e _A_l_s_o_:

     `summary.rpart', `rpart.object'

_E_x_a_m_p_l_e_s_:

     data(car.test.frame)
     z.auto <- rpart(Mileage ~ Weight, car.test.frame)
     printcp(z.auto)

     Regression tree:
     rpart(formula = Mileage ~ Weight, data = car.test.frame)

     Variables actually used in tree construction:
     [1] Weight

     Root node error: 1354.6/60 = 22.576

             CP nsplit rel error  xerror     xstd
     1 0.595349      0   1.00000 1.03436 0.178526
     2 0.134528      1   0.40465 0.60508 0.105217
     3 0.012828      2   0.27012 0.45153 0.083330
     4 0.010000      3   0.25729 0.44826 0.076998

