Receiver Operating Characterstic Curve is a plot of the true positive rate (TPR) against the false positive rate (FPR) for the different thresholds. It is useful for measuring and comparing the accuracy of the classificators.

plot_roc(object, ..., nlabel = NULL)

plotROC(object, ..., nlabel = NULL)

## Arguments

object An object of class 'auditor_model_evaluation' created with model_evaluation function. Other 'auditor_model_evaluation' objects to be plotted together. Number of cutoff points to show on the plot. Default is NULL.

## Value

A ggplot object.

plot_rroc, plot_rec

## Examples

titanic <- na.omit(DALEX::titanic)
titanic$survived <- as.numeric(titanic$survived == "yes")

# fit a model
model_glm <- glm(survived ~ ., family = binomial, data = titanic)

# use DALEX package to wrap up a model into explainer
exp_glm <- DALEX::explain(model_glm, y = titanic$survived)#> Preparation of a new explainer is initiated #> -> model label : lm (default) #> -> data : 2099 rows 9 cols (extracted from model) #> -> target variable : 2099 values #> -> predict function : yhat.glm will be used (default) #> -> predicted values : numerical, min = 9.814966e-09 , mean = 0.3244402 , max = 1 #> -> residual function : difference between y and yhat (default) #> -> residuals : numerical, min = -0.9614217 , mean = -1.68201e-09 , max = 0.9666502 #> A new explainer has been created! # validate a model with auditor library(auditor) eva_glm <- model_evaluation(exp_glm) # plot results plot_roc(eva_glm)plot(eva_glm) #add second model model_glm_2 <- glm(survived ~ .-age, family = binomial, data = titanic) exp_glm_2 <- DALEX::explain(model_glm_2, data = titanic, y = titanic$survived, label = "glm2")#> Preparation of a new explainer is initiated
#>   -> model label       :  glm2
#>   -> data              :  2099  rows  9  cols
#>   -> target variable   :  2099  values
#>   -> predict function  :  yhat.glm  will be used (default)
#>   -> predicted values  :  numerical, min =  1.431371e-08 , mean =  0.3244402 , max =  0.9999999
#>   -> residual function :  difference between y and yhat (default)
#>   -> residuals         :  numerical, min =  -0.9457109 , mean =  -1.684502e-09 , max =  0.9665453
#> A new explainer has been created!eva_glm_2 <- model_evaluation(exp_glm_2)

plot_roc(eva_glm, eva_glm_2)plot(eva_glm, eva_glm_2)