Description Usage Arguments Value Author(s) References See Also Examples
Calculates the absolute misclassification cost value for a set of predictions.
1 2 3 |
predTest |
Vector with predictions (real-valued 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 real-valued 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 (real-valued or discrete). Only used if
|
depVal |
Optional vector with true class labels for validation data. Only
used if |
A list with the following elements:
misclassCost |
Total misclassification cost value |
cutoff |
the threshold value used to convert real-valued predictions to class predictions |
Koen W. De Bock, kdebock@audencia.com
Witten, I.H., Frank, E. (2005): Data Mining: Practical Machine Learning Tools and Techniques, Second Edition. Chapter 5. Morgan Kauffman.
dynConfMatrix
,expMisclassCost
,dynAccuracy
1 2 3 4 5 6 7 8 | ## Load response modeling data set
data("response")
## Generate cost vector
costs <- runif(nrow(response$test), 1, 100)
## Apply misclassCost function to obtain the misclassification cost for the
## predictions for test sample. Assume a cost ratio of 5.
emc<-misclassCost(response$test[,2],response$test[,1],costType="costVector", costs=costs)
print(emc$EMC)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.