Implementation of the ROC and AUC functions.