confusion                package:mda                R Documentation

_C_o_n_f_u_s_i_o_n _M_a_t_r_i_c_e_s

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

     Compute the confusion matrix between two factors, or for an fda or
     mda object.

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

     ## Default S3 method:
     confusion(object, true, ...)
     ## S3 method for class 'fda':
     confusion(object, data, ...)

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

  object: the predicted factor, or an fda or mda model object.

    true: the true factor.

    data: a data frame (list) containing the test data.

     ...: further arguments to be passed to or from methods.

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

     This is a generic function.

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

     For the default method essentially 'table(object, true)', but with
     some useful attribute(s).

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

     'fda', 'predict.fda'

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

     data(iris)
     irisfit <- fda(Species ~ ., data = iris)
     confusion(predict(irisfit, iris), iris$Species)
     ##            Setosa Versicolor Virginica 
     ##     Setosa     50          0         0
     ## Versicolor      0         48         1
     ##  Virginica      0          2        49
     ## attr(, "error"):
     ## [1] 0.02

