softmax                 package:mda                 R Documentation

_F_i_n_d _t_h_e _M_a_x_i_m_u_m _i_n _E_a_c_h _R_o_w _o_f _a _M_a_t_r_i_x

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

     Find the maximum in each row of a matrix.

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

     softmax(x, gap = FALSE)

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

       x: a numeric matrix.

     gap: if 'TRUE', the difference between the largest and next
          largest column is returned.

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

     A factor with levels the column labels of 'x' and values the
     columns corresponding to the maximum column. If 'gap = TRUE' a
     list is returned, the second component of which is the difference
     between the largest and next largest column of 'x'.

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

     'predict.fda', 'confusion', 'fda'

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

     data(iris)
     irisfit <- fda(Species ~ ., data = iris)
     posteriors <- predict(irisfit, type = "post")
     confusion(softmax(posteriors), iris[, "Species"])

