Skip to contents

ROC curves for out-of-bag random forest predictions.

Usage

roc(x)

# S4 method for RandomForest
roc(x)

# S4 method for list
roc(x)

# S4 method for Analysis
roc(x)

Arguments

x

S4 object of class RandomForest, Analysis or a list

Value

A tibble containing the ROC curves.

Examples

library(metaboData)

x <- analysisData(abr1$neg[,200:300],abr1$fact) %>%
       occupancyMaximum(cls = 'day') %>%
       transformTICnorm()
       
rf <- randomForest(x,cls = 'day')

roc(rf)
#> # A tibble: 711 × 6
#>    response comparison  Class .threshold specificity sensitivity
#>    <chr>    <chr>       <chr>      <dbl>       <dbl>       <dbl>
#>  1 day      1~2~3~4~5~H 1     -Inf            0                1
#>  2 day      1~2~3~4~5~H 1        0            0                1
#>  3 day      1~2~3~4~5~H 1        0.00503      0.0100           1
#>  4 day      1~2~3~4~5~H 1        0.00538      0.0200           1
#>  5 day      1~2~3~4~5~H 1        0.0103       0.0300           1
#>  6 day      1~2~3~4~5~H 1        0.0105       0.0400           1
#>  7 day      1~2~3~4~5~H 1        0.0117       0.0500           1
#>  8 day      1~2~3~4~5~H 1        0.0144       0.0600           1
#>  9 day      1~2~3~4~5~H 1        0.0157       0.0700           1
#> 10 day      1~2~3~4~5~H 1        0.0222       0.0800           1
#> # ℹ 701 more rows