[.] Do ROC analysis and plot it's results (ROC_)

ROC_(x, labels, label.ordering = NULL, make_plots = TRUE)

ROC_table(prediction.obj)

ROC_plots(prediction.obj)

Arguments

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.

make_plots

Logical. If TRUE (default) Sensitivity-Specificity plot and plot of sensitivity and specificity at each cot-off point are plotted.

prediction.obj

An object of class prediction.

Value

A) plots as listed in description of make_plots.

B) Table of performance measures a optimal cut of point.

See also

This function is based on package ROCR.

Author

Vilmantas Gegzna

Examples


library(ROCR)
library(spHelper)

data(ROCR.simple)
ROC_(ROCR.simple$predictions, ROCR.simple$labels)
#> Warning: Input variable `labels` is converted to factor variable.
#> 
#>    0 vs. 1 
#>   
#> Error: '.define.environments' is not an exported object from 'namespace:ROCR'
  ##  Compared groups                      "0 vs. 1"
  ##  Group treated as positive            "1"
  ##  AUC                                  "0.83"
  ##  Cut-off                              "0.5015"
  ##  Sensitivity (True positive rate, Se) "0.85"
  ##  Specificity (True negative rate, Sp) "0.85"
  ##  Mean of Se and Sp                    "0.85"