powered by
This function calculates the area under ROC curve
cal_auc(X, Y)
A vector of true positive rate
A vector of false positive rate, same length with TPR
A numeric value of AUC will be returned.
This function calculates the area under ROC curve.
https://www.r-bloggers.com/calculating-auc-the-area-under-a-roc-curve/
cal_confus()
# 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