diagnosticsJson.Rd
Calculates and writes fit statistics, roc and lift for binary and fit statistics for interval.
diagnosticsJson(
targetName,
targetPredicted,
validadedf = NULL,
traindf = NULL,
testdf = NULL,
type = "binary",
targetEventValue = 1,
cutoff = 0.5,
label.ordering = c(0, 1),
path = "./",
noFile = FALSE
)
target variable name (actuals)
target variable probability column name
data.frame
where the first column in the yActual (labels/value) and the second is yPrediction (target probability)
data.frame
where the first column in the yActual (labels/value) and the second is yPrediction (target probability)
data.frame
where the first column in the yActual (labels/value) and the second is yPrediction (target probability)
"binary"
or "interval"
if type = "binary"
target class name for fit stat reference, if model is nominal, all other class will be counted as "not target"
cutoff to be used for calculation of miss classification for binary
The default ordering (cf.details) of the classes can be changed by supplying a vector containing the negative and the positive class label. See ROCR::prediction()
default to current work dir
if you don't want to write to a file, only the output
list
of lists that reflects the 'dmcas_fitstat.json', 'dmcas_roc.json' and 'dmcas_lift.json'
'dmcas_fitstat.json', 'dmcas_roc.json' and 'dmcas_lift.json' files written to path
All parameters are passed to calculateLiftStat()
, calculateLiftStat()
and calculateLiftStat()
for matching parameters.
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
diagnosticsJson(df[df$partition == 1, ],
df[df$partition == 2, ],
df[df$partition == 3, ],
targetName = "label",
targetPredicted = "prob",
noFile = TRUE
)