Learn R Programming

funModeling (version 1.9.5)

gain_lift: Generates lift and cumulative gain performance table and plot

Description

It retrieves the cumulative positive rate -gain curve- and the lift chart & plot when score is divided in 5, 10 or 20 segments. Both metrics give a quality measure about how well the model predicts. Higher values at the beginning of the population implies a better model. More info at: https://livebook.datascienceheroes.com/model-performance.html#scoring_data

Usage

gain_lift(data, score, target, q_segments = 10)

Value

lift/gain table, column: gain implies how much positive cases are catched if the cut point to define the positive class is set to the column "Score Point"

Arguments

data

input data source

score

the variable which contains the score number, or likelihood of being positive class

target

target binary variable indicating class label

q_segments

quantity of segments to split score variable, valid values: 5, 10 or 20

Examples

Run this code
fit_glm=glm(has_heart_disease ~ age + oldpeak, data=heart_disease, family = binomial)
heart_disease$score=predict(fit_glm, newdata=heart_disease, type='response')
gain_lift(data=heart_disease, score='score', target='has_heart_disease')

Run the code above in your browser using DataLab