The Receiver Operating Characteristic (ROC) is a fundamental tool used in binary classification to determine the accuracy of a model. It is a graphical plot that represents the true positive rate (TPR) against the false positive rate (FPR) at various threshold settings.
The area under the ROC curve, also known as AUC-ROC, serves as an aggregate measure of a model's performance across all possible classification thresholds. An AUC-ROC of 1 indicates perfect classification, whereas an AUC-ROC of 0.5 suggests that the model's ability to distinguish between positive and negative classes is no better than random guessing.
ROC analysis provides tools to select possibly optimal models and to discard suboptimal ones independently from (and prior to specifying) the cost context or the class distribution. ROC analysis is related in a direct and natural way to cost/benefit analysis of diagnostic decision making.
The True Positive Rate (TPR), also known as sensitivity or recall, is calculated as follows:
$$ TPR = \frac{TP}{TP+FN} $$
The False Positive Rate (FPR) is calculated as follows:
$$ FPR = \frac{FP}{FP+TN} $$
