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, hyperparameters = setup_GLM())
#> 2026-08-09 13:22:37 
#> Checking data is ready for training...
#>  
#>
#> [check_supervised]
#> 2026-08-09 13:22:37 
#>
#>  [train]
#> 2026-08-09 13:22:37 
#> Training set: 100 cases x 4 features.
#>  [summarize_supervised]
#> 2026-08-09 13:22:37 
#> // Max workers: c(system = 7) { Algorithm: 1; Tuning: 1; Outer Resampling: 1 }
#>  [get_n_workers]
#> 2026-08-09 13:22:37 
#> Training GLM Classification...
#>  [train]
#> 2026-08-09 13:22:37 
#> 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-08-09 13:22:37 
#> Done in 0.02 seconds.
#>  [train]
plot_roc(species_glm)