calculateAUC             package:rattle             R Documentation

_D_e_t_e_r_m_i_n_e _a_r_e_a _u_n_d_e_r _a _c_u_r_v_e (_e._g. _a _r_i_s_k _o_r _r_e_c_a_l_l _c_u_r_v_e) _o_f _a _r_i_s_k _c_h_a_r_t

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

     Given the evaluation returned by evaluateRisk, for example,
     calculate the area under the risk or recall curves, to use as a
     metric to compare the performance of a model.

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

     calculateAUC(x, y)

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

       x: a vector of values for the x points.

       y: a vector of values for the y points.

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

     The area is returned.

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

     Graham.Williams@togaware.com

_R_e_f_e_r_e_n_c_e_s:

     Package home page: <URL: http://rattle.togaware.com>

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

     'evaluateRisk'.

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

     ## this is usually used in the context of the evaluateRisk function
     ## Not run: ev <- evaluateRisk(predicted, actual, risk)

     ## imitate this output here
     ev <- data.frame(Caseload=c(1.0, 0.8, 0.6, 0.4, 0.2, 0),
                      Precision=c(0.15, 0.18, 0.21, 0.25, 0.28, 0.30),
                      Recall=c(1.0, 0.95, 0.80, 0.75, 0.5, 0.0),
                      Risk=c(1.0, 0.98, 0.90, 0.77, 0.30, 0.0))

     ## Calculate the areas unde the Risk and the Recall curves.
     calculateAUC(ev$Caseload, ev$Risk)
     calculateAUC(ev$Caseload, ev$Recall)

