lift_curve: Lift curve graph

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/lift_curve.R

Description

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

Usage

1
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.

Author(s)

Simon CORDE

References

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

See Also

lift_effect

Examples

1
2
3
4
5
6
7
8
9
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

helda documentation built on Jan. 6, 2021, 5:09 p.m.