Learn R Programming

EMP (version 1.0.2)

calcROC: calcROC

Description

Computes the convex hull of the ROC curve created from scores and a positive class.

Usage

calcROC(score, class, positive = 1)

Arguments

score
The probability, in the range [0,1] to be scored.
class
The class of the cases. Either 0 or 1.
positive
Optional. The class for which to build the ROC curve. Defaults to 1.

Value

  • An object with the convex hull of the ROC curve, with all the parameters necessary to estimate EMP.
  • n1Number of positive cases.
  • n2Number of negative cases.
  • pi0Percentage of negative cases.
  • pi1Percentage of positive cases.
  • F1rocCumulative ROC over positive cases.
  • F0rocCumulative ROC over negative cases.
  • F1chX axis of the convex hull of the ROC curve
  • F0chY axis of the convex hull of ROC curve

References

Verbraken, T., Verbeke, W. & Baesens, B., 2011. Novel Profit Maximizing Metrics for Measuring Classification Performance of Customer Churn Prediction Models. IEEE Transactions on Knowledge and Data Engineering 25(2): 961-973.

See Also

See Also EMP_CS.

Examples

Run this code
# Dummy dataset.
score.ex <- runif(1000, 0, 1)
class.ex <- lapply(score.ex, function(x){rbinom(1,1,x)})
class.ex <- unlist(class.ex)

# Calculate ROC curve.
ROC.ex <- calcROC(score.ex, class.ex)
ROC.ex

Run the code above in your browser using DataLab