Calculates the lift curves from user data and writes to a JSON file for importing into the common model repository. Binary response only.

calculateLiftStat(
  targetName,
  targetPredicted,
  validadedf = NULL,
  traindf = NULL,
  testdf = NULL,
  targetEventValue = 1,
  path = "./",
  noFile = FALSE
)

Arguments

targetName

target variable column name (actuals)

targetPredicted

target variable predicted probability column name

validadedf

data.frame where the first column in the yActual (labels/value) and the second is yPrediction (target probability)

traindf

data.frame where the first column in the yActual (labels/value) and the second is yPrediction (target probability)

testdf

data.frame where the first column in the yActual (labels/value) and the second is yPrediction (target probability)

targetEventValue

target class name for ROC reference, if model is nominal, all other class will be counted as "not target"

path

default to current work dir

noFile

if you don't want to write to a file, only the output

Value

  • list that reflects the 'dmcas_roc.json'

  • 'dmcas_roc.json' file written to path

Examples


df <- data.frame(label = sample(c(1,0), 6000, replace = TRUE),
                 prob = runif(6000),
                 partition = rep_len(1:3, 6000)) ## partition will be ignored since it is 3rd column

calculateLiftStat(targetName = "label",
                  targetPredicted = "prob",
                  df[df$partition == 1, ],
                  df[df$partition == 2, ],
                  df[df$partition == 3, ],
                  noFile = TRUE)