LIFT is a plot of the rate of positive prediction against true positive rate for the different thresholds. It is useful for measuring and comparing the accuracy of the classificators.

plot_lift(object, ...)

plotLIFT(object, ...)

Arguments

object

An object of class 'auditor_model_evaluation' created with model_evaluation function.

...

Other 'auditor_model_evaluation' objects to be plotted together.

Value

A ggplot object.

See also

Examples

titanic <- na.omit(DALEX::titanic) titanic$survived <- 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, data = titanic, y = titanic$survived)
#> Preparation of a new explainer is initiated #> -> model label : lm ( default ) #> -> data : 2099 rows 9 cols #> -> target variable : 2099 values #> -> data : A column identical to the target variable `y` has been found in the `data`. ( WARNING ) #> -> data : It is highly recommended to pass `data` without the target variable column #> -> 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_lift(eva_glm)
plot(eva_glm, type ="lift")
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 #> -> data : A column identical to the target variable `y` has been found in the `data`. ( WARNING ) #> -> data : It is highly recommended to pass `data` without the target variable column #> -> 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_lift(eva_glm, eva_glm_2)
plot(eva_glm, eva_glm_2, type = "lift")