plotD3_lift: Plot LIFT in D3 with r2d3 package.

View source: R/plotD3_lift.R

plotD3_liftR Documentation

Plot LIFT in D3 with r2d3 package.

Description

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.

Usage

plotD3_lift(object, ..., scale_plot = FALSE, zeros = TRUE)

plotD3LIFT(object, ..., scale_plot = FALSE)

Arguments

object

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

...

Other 'auditor_model_evaluation' objects to be plotted together.

scale_plot

Logical, indicates whenever the plot should scale with height. By default it's FALSE.

zeros

Logical. It makes the lines start from the (0,0) point. By default it's TRUE.

Value

a r2d3 object

See Also

plot_lift

Examples

data(titanic_imputed, package = "DALEX")

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

glm_audit <- audit(model_glm,
                   data = titanic_imputed,
                   y = titanic_imputed$survived)

# validate a model with auditor
eva_glm <- model_evaluation(glm_audit)

# plot results
plot_roc(eva_glm)
plot(eva_glm)

#add second model
model_glm_2 <- glm(survived ~ .-age, family = binomial, data = titanic_imputed)
glm_audit_2 <- audit(model_glm_2,
                     data = titanic_imputed,
                     y = titanic_imputed$survived,
                     label = "glm2")
eva_glm_2 <- model_evaluation(glm_audit_2)

plotD3_lift(eva_glm, eva_glm_2)


auditor documentation built on Nov. 2, 2023, 6:13 p.m.