Learn R Programming

multiROC (version 1.1.1)

cal_auc: Area under ROC curve

Description

This function calculates the area under ROC curve

Usage

cal_auc(X, Y)

Arguments

X

A vector of true positive rate

Y

A vector of false positive rate, same length with TPR

Value

A numeric value of AUC will be returned.

Details

This function calculates the area under ROC curve.

References

https://www.r-bloggers.com/calculating-auc-the-area-under-a-roc-curve/

See Also

cal_confus()

Examples

Run this code
# NOT RUN {
data(test_data)
true_vec <- test_data[, 1]
pred_vec <- test_data[, 5]
confus_res <- cal_confus(true_vec, pred_vec)
AUC_res <- cal_auc(confus_res$TPR, confus_res$FPR)
# }

Run the code above in your browser using DataLab