The ROC curves of a fitted classification model for each sample it stores
predicted probabilities for: the data plot_roc() draws, as a table.
roc_table(
x,
sample = NULL,
variant = "aggregate",
positive = NULL,
max_points = NULL
)data.table with columns sample; resample, for variant = "per_resample"; class; fpr; tpr; auc, constant within a curve;
and omitted.
Classification or ClassificationRes object.
Optional Character {"training", "validation", "test"}: The
sample whose curves to return. NULL returns every sample with predicted
probabilities.
Character {"aggregate", "per_resample"}: For a resampled model, pooled curves or one curve per resample. An ordinary model has aggregate curves only.
Optional Character: Positive class of a binary model. NULL
uses the second level of the outcome.
Optional Integer [2, Inf): Cap on the number of vertices
per curve. NULL keeps every vertex.
EDG
Binary models have one curve, for the positive class; multiclass models have
one one-vs-rest curve per class. For a resampled model, variant = "aggregate" pools the predictions of every outer resample into one curve
per sample and class, and variant = "per_resample" gives one curve per
resample, labeled in the resample column. A resample whose probabilities
are missing has an undefined curve, with auc NA. omitted counts the
cases whose probability or label is missing.
roc_curve() computes the curve of supplied labels and probabilities.
mod <- train(iris, hyperparameters = setup_CART(), verbosity = 0L)
roc_table(mod)
Run the code above in your browser using DataLab