lift_effect: Lift effect curve

View source: R/lift_effect.R

lift_effectR Documentation

Lift effect curve

Description

This function allows to draw the lift effect on a graph for binary classification model

Usage

lift_effect(predictions, true_labels, positive_label)

Arguments

predictions

a vector of predictions. These are generally the result of a machine learning model. The predictions must be probabilities (a real number between 0 and 1).

true_labels

a vector of true labels.

positive_label

a character or integer that specify the positive label (Y=1) in the 'true_labels'.

Value

a ggplot object containing the lift effect.

Author(s)

Simon CORDE

References

Link to the author's github package repository: https://github.com/Redcart/helda

See Also

lift_curve

Examples

data_training <- titanic_training
data_validation <- titanic_validation
model_glm <- glm(formula = "Survived ~ Pclass + Sex + Age + SibSp + Fare + Embarked",
data = data_training,
family = binomial(link = "logit"))
predictions <- predict(object = model_glm, newdata = data_validation, type = "response")
plot <- lift_effect(predictions = predictions, true_labels = data_validation$Survived,
positive_label = 1)
plot

Redcart/helda documentation built on March 3, 2023, 11:55 p.m.