expMisclassCost {CustomerScoringMetrics}  R Documentation 
Calculates the expected misclassification cost value for a set of predictions.
expMisclassCost(predTest, depTest, costType = c("costRatio", "costMatrix"), costs = NULL, cutoff = 0.5, dyn.cutoff = FALSE, predVal = NULL, depVal = NULL)
predTest 
Vector with predictions (realvalued or discrete) 
depTest 
Vector with real class labels 
costType 
An argument that specifies how the cost information is provided. This
should be either 
costs 
see 
cutoff 
Threshold for converting realvalued predictions into class predictions. Default 0.5. 
dyn.cutoff 
Logical indicator to enable dynamic threshold determination using
validation sample predictions. In this case, the function determines, using validation
data, the indidicence (occurrence percentage of the customer behavior or characterstic
of interest) and chooses a cutoff value so that the number of predicted positives is
equal to the number of true positives. If 
predVal 
Vector with predictions (realvalued or discrete). Only used if

depVal 
Optional vector with true class labels for validation data. Only used
if 
A list with
EMC 
expected misclassification cost value 
cutoff 
the threshold value used to convert realvalued predictions to class predictions 
Koen W. De Bock, kdebock@audencia.com
## Load response modeling data set data("response") ## Apply expMisclassCost function to obtain the misclassification cost for the ## predictions for test sample. Assume a cost ratio of 5. emc<expMisclassCost(response$test[,2],response$test[,1],costType="costRatio", costs=5) print(emc$EMC)