dx_auc | R Documentation |
Calculates the Area Under the Receiver Operating Characteristic (ROC) Curve from prediction probabilities and true binary outcomes. AUC is a measure of the ability of a classifier to distinguish between classes and is used as a summary of the ROC curve.
dx_auc(truth, predprob, detail = "full")
truth |
Vector of true binary class outcomes (0 and 1). |
predprob |
Vector of prediction probabilities corresponding to the true outcomes. |
detail |
Character string specifying the level of detail in the output: "simple" for just the AUC value, "full" for the AUC value along with confidence intervals. |
Depending on the detail
parameter, returns a single numeric value of AUC or
a data frame with the AUC and its confidence intervals.
# Assuming you have a vector of true class labels and predicted probabilities
true_classes <- c(1, 0, 1, 1, 0, 0, 1)
predicted_probs <- c(0.9, 0.1, 0.8, 0.75, 0.33, 0.25, 0.67)
simple_auc <- dx_auc(true_classes, predicted_probs, detail = "simple")
detailed_auc <- dx_auc(true_classes, predicted_probs)
print(simple_auc)
print(detailed_auc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.