roc_points | R Documentation |
Calculates a series pairs of (FPR, TPR) which correspond to points displayed by ROC curve. "false positive ratio" will be represented on x axis, while "true positive ratio" on y one.
roc_points(data = NULL, response, predictor, .condition = NULL)
data |
A data.frame or extension (e.g. a tibble) containing values for predictors and response variables. |
response |
A data variable which must be a factor, integer or character vector representing the prediction outcome on each observation (Gold Standard). If the variable presents more than two possible outcomes, classes or categories:
New combined category represents the "absence" of the condition to predict.
See |
predictor |
A data variable which must be numeric, representing values of a classifier or predictor for each observation. |
.condition |
A value from response that represents class, category or condition of interest which wants to be predicted. If Once the class of interest is selected, rest of them will be collapsed in a common category, representing the "absence" of the condition to be predicted. See |
A tibble with two columns:
"tpr". Containing values for "true positive ratio", or y axis.
"fpr". Containing values for "false positive ratio", or x axis.
# Calc ROC points of Sepal.Width as a classifier of setosa species
roc_points(iris, Species, Sepal.Width)
# Change class to predict to virginica
roc_points(iris, Species, Sepal.Width, .condition = "virginica")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.