which.is.max              package:nnet              R Documentation

_F_i_n_d _M_a_x_i_m_u_m _P_o_s_i_t_i_o_n _i_n _V_e_c_t_o_r

_D_e_s_c_r_i_p_t_i_o_n:

     Find the maximum position in a vector, breaking ties at random.

_U_s_a_g_e:

     which.is.max(x)

_A_r_g_u_m_e_n_t_s:

       x: a vector 

_D_e_t_a_i_l_s:

     Ties are broken at random.

_V_a_l_u_e:

     index of a maximal value.

_R_e_f_e_r_e_n_c_e_s:

     Venables, W. N. and Ripley, B. D. (2002) _Modern Applied
     Statistics with S._ Fourth edition.  Springer.

_S_e_e _A_l_s_o:

     'max.col', 'which.max' which takes the first of ties.

_E_x_a_m_p_l_e_s:

     ## Not run: 
     pred <- predict(nnet, test)
     table(true, apply(pred,1,which.is.max))
     ## End(Not run)

