getROC | R Documentation |
The 'getROC' function calculates the ROC curve given the test and truth values for binary classes. The true class must be binary. The test metric should be numeric.
getROC(truth, test.metric, step.size = 0.05)
truth |
The true class (0 or 1) of each observation, a binary vector. |
test.metric |
The test metric, a numeric vector. |
step.size |
The step size for the ROC curve. |
Coordinates on the ROC curve, that is, the false positive rate (fpr) and the true positive rate (tpr) values at each step.
## NOT RUN # res <- getROC(truth = rep(0:1, each = 5), test.metric = c(1:10)) # ## useful function for calculating the area under the ROC curve: # DescTools::AUC(res$tpr, res$fpr)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.