gain_lift: Generates lift and cumulative gain performance table and plot

View source: R/models_lib.R

gain_liftR Documentation

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)

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

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"

Examples

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')


pablo14/funModeling documentation built on July 30, 2023, 10:59 a.m.