lift_effect | R Documentation |
This function allows to draw the lift effect on a graph for binary classification model
lift_effect(predictions, true_labels, positive_label)
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'. |
a ggplot object containing the lift effect.
Simon CORDE
Link to the author's github package repository: https://github.com/Redcart/helda
lift_curve
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.