Learn R Programming

helda (version 1.1.5)

lift_curve: Lift curve graph

Description

This function allows to draw a lift curve in a ggplot style for binary classification model

Usage

lift_curve(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 curve.

References

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

See Also

lift_effect

Examples

Run this code
# NOT RUN {
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_curve(predictions = predictions, true_labels = data_validation$Survived,
positive_label = 1)
plot
# }

Run the code above in your browser using DataLab