margin             package:randomForest             R Documentation

_M_a_r_g_i_n_s _o_f _r_a_n_d_o_m_F_o_r_e_s_t _C_l_a_s_s_i_f_i_e_r

_D_e_s_c_r_i_p_t_i_o_n:

     Compute or plot the margin of predictions from a randomForest
     classifier.

_U_s_a_g_e:

     margin(rf, observed)
     ## S3 method for class 'margin':
     plot(x, sort=TRUE, ...)

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

      rf: an object of class 'randomForest', whose 'type' is not
          'regression'.

observed: the response variable (a factor) used to train 'rf'.

       x: an object of class 'margin', as returned by the function
          'margin'.

    sort: Should the data be sorted by their class labels?

     ...: other graphical parameters to be passed to 'plot.default'.

_V_a_l_u_e:

     For 'margin', the _margin_ of observations from the 'randomForest'
     classifier.  The margin of a data point is defined as the
     proportion of votes for the correct class minus maximum proportion
     of votes for the other classes.  Thus under majority votes,
     positive margin means correct classification, and vice versa.

_A_u_t_h_o_r(_s):

     Robert Gentlemen, with slight modifications by Andy Liaw

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

     'randomForest'

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

     set.seed(1)
     data(iris)
     iris.rf <- randomForest(Species ~ ., iris, keep.forest=FALSE)
     plot(margin(iris.rf, iris$Species))

