ROCcurve | R Documentation |
Plot a ROC curve from a caret model.
ROCcurve(model, ...) ## S3 method for class 'train' ROCcurve( model, testdata = NULL, testy = NULL, testindex = NULL, thrs = NULL, use.pROC = FALSE, calc.train = TRUE, errorFunction = ci_95, ... ) ## S3 method for class 'ROCcurve' plot( x, type = "facet", select.thr = "all", plot_ci = TRUE, add.text = TRUE, ... )
model |
A model or a list of models returned by |
... |
Arguments passed to |
testdata |
A data.frame with test values to be use in ROC curve. If |
testy |
A factor of response variable of |
testindex |
A list with rows index of testdata for each resample, preferably an output of
|
thrs |
A named vector with thresholds values between [0,1] to be plotted in the ROC curve
or the output of |
use.pROC |
logical. If |
calc.train |
logical. If |
errorFunction |
A function used to calculate confidence interval across resamples.
Function is ignored if |
x |
An objected returned by ROCcurve. |
type |
one of "facet", "train" or "test". |
select.thr |
"all", "none" or a vector with indices of thresholds to plot. |
plot_ci |
logical. Plot confidence intervals? |
add.text |
logical. Plot threshold methods names? |
An S3 object of class 'ROCcurve', including:
dat.roc |
A data.table with values of Sensitivity and Specificity to plot the ROC curve. |
thrs |
A data.table with Sensitivity and Specificity for each threshold provided by |
coords |
A data.table with the coordinates to plot the confidence interval. |
evaluate
confusionMatrix2
## Not run: # using pROC package ROCcurve(model, use.pROC = TRUE) # using caret resamples, with testdata and thresholds testindex <- create.test.index(testy) thrs <- thresholder2(model) r.obj <- ROCcurve(model, testdata, testy, testindex, thrs, use.pROC = FALSE) plot(r.obj, type = "facet", select.thr = 3:7, plot_ci = TRUE, add.text = FALSE) # for multiple models models <- list(model1, model2, model3) thrs <- lapply(models, thresholder2) r.obj <- ROCcurve(models, thrs, testdata, testindex=testindex) plot(r.obj, type = "test", select.thr = 3:7, plot_ci = FALSE, add.text = TRUE) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.