cutoffSensitivityPlot {CustomerScoringMetrics}R Documentation

Plot a sensitivity plot for cutoff values

Description

Visualize the sensitivity of a chosen metric to the choice of the threshold (cutoff) value used to transform continuous predictions into class predictions.

Usage

cutoffSensitivityPlot(predTest, depTest, metric = c("accuracy",
  "expMisclassCost", "misclassCost"), costType = c("costRatio", "costMatrix",
  "costVector"), costs = NULL, resolution = 1/50)

Arguments

predTest

Vector with predictions (real-valued or discrete)

depTest

Vector with true class labels

metric

Which metric to assess. Should be one of the following values: "accuracy", "misclassCost" or "expMisclassCost".

costType

An argument that specifies how the cost information is provided. This should be either "costRatio" or "costMatrix" when metric equals "expMisclassCost"; or "costRatio", "costVector" or "costMatrix" when metric equals "MisclassCost". In the former case, a single value is provided which reflects the cost ratio (the ratio of the cost associated with a false negative to the cost associated with a false positive). In the latter case, a full (4x4) misclassification cost matrix should be provided in the form rbind(c(0,3),c(15,0)) where in this example 3 is the cost for a false positive, and 15 the cost for a false negative case.

costs

see costType

resolution

Value for the determination of percentile intervals. Default 1/10 (10%).

Author(s)

Koen W. De Bock, kdebock@audencia.com

See Also

dynAccuracy, misclassCost, expMisclassCost

Examples

## Load response modeling predictions
data("response")
## Apply cutoffSensitivityPlot function to visualize how the cutoff value influences
## accuracy.
cutoffSensitivityPlot(response$test[,2],response$test[,1],metric="accuracy")
## Same exercise, but in function of misclassification costs
costs <- runif(nrow(response$test), 1, 50)
cutoffSensitivityPlot(response$test[,2],response$test[,1],metric="misclassCost",
costType="costVector",costs=costs, resolution=1/10)


[Package CustomerScoringMetrics version 1.0.0 Index]