prediction               package:ROCR               R Documentation

_F_u_n_c_t_i_o_n _t_o _c_r_e_a_t_e _p_r_e_d_i_c_t_i_o_n _o_b_j_e_c_t_s

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

     Every classifier evaluation using ROCR starts with creating a
     'prediction' object. This function is used to transform the input
     data (which can be in vector, matrix, data frame, or list form)
     into a standardized format.

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

     prediction(predictions, labels, label.ordering = NULL)

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

predictions: A vector, matrix, list, or data frame containing the
          predictions.

  labels: A vector, matrix, list, or data frame containing the true
          class labels. Must have the same dimensions as 'predictions'.

label.ordering: The default ordering (cf.details)  of the classes can
          be changed by supplying a vector containing the negative and
          the positive class label.

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

     'predictions' and 'labels' can simply be vectors of the same
     length. However, in the case of cross-validation data, different
     cross-validation runs can be provided as the *columns* of a matrix
     or data frame, or as the entries of a list. In the case of a
     matrix or data frame, all cross-validation runs must have the same
     length, whereas in the case of a list, the lengths can vary across
     the cross-validation runs. Internally, as described in section
     'Value', all of these input formats are converted to list
     representation.

     Since scoring classifiers give relative tendencies towards a
     negative (low scores) or positive (high scores) class, it has to
     be declared which class label denotes the negative, and which the
     positive class. Ideally, labels should be supplied as ordered
     factor(s), the lower level corresponding to the negative class,
     the upper level to the positive class. If the labels are factors
     (unordered), numeric, logical or characters, ordering of the
     labels is inferred from R's built-in '<' relation (e.g. 0 < 1, -1
     < 1, 'a' < 'b', FALSE < TRUE). Use 'label.ordering' to override
     this default ordering. Please note that the ordering can be
     locale-dependent e.g. for character labels '-1' and '1'.

     Currently, ROCR supports only binary classification (extensions
     toward multiclass classification are scheduled for the next
     release, however). If there are more than two distinct label
     symbols, execution stops with an error message. If all predictions
     use the same two symbols that are used for the labels, categorical
     predictions are assumed. If there are more than two predicted
     values, but all numeric, continuous predictions are assumed (i.e.
     a scoring classifier). Otherwise, if more than two symbols occur
     in the predictions, and not all of them are numeric, execution
     stops with an error message.

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

     An S4 object of class 'prediction'.

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

     Tobias Sing tobias.sing@mpi-sb.mpg.de, Oliver Sander
     osander@mpi-sb.mpg.de

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

     A detailed list of references can be found on the ROCR homepage at
     <URL: http://rocr.bioinf.mpi-sb.mpg.de>.

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

     'prediction-class', 'performance', 'performance-class',
     'plot.performance'

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

     # create a simple prediction object
     library(ROCR)
     data(ROCR.simple)
     pred <- prediction(ROCR.simple$predictions,ROCR.simple$labels)

