Classification Metrics
Once a classification model is built, its effectiveness is evaluated using quantities derived from the confusion matrix, which summarizes prediction outcomes in terms of true/false positives/negatives, such that false positives are negative cases incorrectly predicted as positive, and vice-versa. From these four outcomes, several key metrics are defined:
- Accuracy is proportion of all predictions that are correct:
- Precision is the proportion of predicted positives that are actually positive:
- Recall (True Positive Rate) is the proportion of actual positives that were correctly identified:
- False Positive Rate is the proportion of actual negatives misclassified as positives:
- F1 Score is the harmonic mean of precision and recall, balancing both measures:
These metrics can be used in tandem to determine a classification threshold for binary classifiers. For example,
- Precision–Recall Tradeoff: Precision () and recall () can be plotted for all thresholds to observe how improving one often reduces the other. The balance point depends on the application’s tolerance for false positives and false negatives.
⠀- Maximum Threshold: The threshold that maximizes represents the best balance between precision and recall when both are equally important.
⠀- ROC Curve and AUC: The ROC curve is constructed by sweeping the classification threshold from 0 to 1 and plotting the TPR/Recall () against the FPR () to show how sensitivity and false alarm rates change as the cutoff varies. The Area Under the Curve (AUC) summarizes overall separability: an AUC of 1 indicates perfect classification, while 0.5 corresponds to random guessing.
Choosing the optimal classification threshold depends on the tradeoff between false positives and false negatives. When classes are balanced, the threshold is typically set to maximize accuracy (often near ), while for imbalanced data or when positive predictions matter more, it is chosen to maximize the score. Accuracy and are threshold-dependent, whereas AUC-based metrics are not.