Skip to contents

This generic is used to plot the ROC curve for a model.

Usage

plot_roc(x, ...)

Arguments

x

Classification or ClassificationRes object.

...

Additional arguments passed to the plotting function.

Value

A plotly object containing the ROC curve.

Author

EDG

Examples

ir <- iris[51:150, ]
ir[["Species"]] <- factor(ir[["Species"]])
species_glm <- train(ir, algorithm = "GLM")
#> 2026-02-22 18:59:30 
#>
#>  [train]
#> 2026-02-22 18:59:30 
#> Training set: 100 cases x 4 features.
#>  [summarize_supervised]
#> 2026-02-22 18:59:30 
#> // Max workers: 7 => Algorithm: 1; Tuning: 1; Outer Resampling: 1
#>  [get_n_workers]
#> 2026-02-22 18:59:30 
#> Training GLM Classification...
#>  [train]
#> 2026-02-22 18:59:30 
#> Checking data is ready for training...
#>  
#>  
#> [check_supervised]
#> 
#> 
#> <Classification>
#> GLM (Generalized Linear Model)
#> 
#>   <Training Classification Metrics>
#>                      Predicted
#>           Reference  virginica  versicolor  
#>           virginica         49           1
#>          versicolor          1          49
#> 
#>                      Overall  
#>         Sensitivity  0.980  
#>         Specificity  0.980  
#>   Balanced_Accuracy  0.980  
#>                 PPV  0.980  
#>                 NPV  0.980  
#>                  F1  0.980  
#>            Accuracy  0.980  
#>                 AUC  0.997  
#>         Brier_Score  0.019  
#> 
#>      Positive Class virginica
#> 
#> 2026-02-22 18:59:30 
#>  Done in 0.03 seconds.
#>  [train]
plot_roc(species_glm)