Learn R Programming

ggRandomForests (version 1.0.0)

calc_roc.rfsrc: Internal Reciever Operator Characteristic calculator for randomForest objects

Description

Internal Reciever Operator Characteristic calculator for randomForest objects

Usage

calc_roc.rfsrc(rf, dta, which.outcome = "all", oob = TRUE)

Arguments

rf
randomForestSRC::rfsrc or randomForestSRC::predict object containing predicted response
dta
True response variable
which.outcome
If defined, only show ROC for this response.
oob
Use OOB estimates, the normal validation method (TRUE)

Details

Given the randomForest or 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.

See Also

calc_auc gg_roc plot.gg_roc

Examples

Run this code
##
## Taken from the gg_roc example
iris.obj <- rfsrc(Species ~ ., data = iris)
roc <- calc_roc.rfsrc(iris.obj, iris.obj$yvar, which.outcome=1, oob=TRUE)

Run the code above in your browser using DataLab