calc_roc.rfsrc {ggRandomForests} | R Documentation |
Receiver Operator Characteristic calculator
Description
Receiver Operator Characteristic calculator
Usage
## S3 method for class 'rfsrc'
calc_roc(object, dta, which_outcome = "all", oob = TRUE, ...)
Arguments
object |
|
dta |
True response variable |
which_outcome |
If defined, only show ROC for this response. |
oob |
Use OOB estimates, the normal validation method (TRUE) |
... |
extra arguments passed to helper functions |
Details
For a randomForestSRC prediction and the actual response value, calculate the specificity (1-False Positive Rate) and sensitivity (True Positive Rate) of a predictor.
This is a helper function for the gg_roc
functions, and
not intended for use by the end user.
Value
A gg_roc
object
See Also
Examples
## Taken from the gg_roc example
rfsrc_iris <- rfsrc(Species ~ ., data = iris)
gg_dta <- calc_roc(rfsrc_iris, rfsrc_iris$yvar,
which_outcome=1, oob=TRUE)
gg_dta <- calc_roc(rfsrc_iris, rfsrc_iris$yvar,
which_outcome=1, oob=FALSE)
rf_iris <- randomForest(Species ~ ., data = iris)
gg_dta <- calc_roc(rf_iris, rf_iris$yvar,
which_outcome=1)
gg_dta <- calc_roc(rf_iris, rf_iris$yvar,
which_outcome=2)
[Package ggRandomForests version 2.2.1 Index]