A classifier gives each item a score, and you choose where to draw the line. Slide that line and watch accuracy, precision, recall, F1 and ROC-AUC respond, and learn why one number is never enough.
Every prediction is one of four outcomes: a true positive (TP), false positive (FP), false negative (FN) or true negative (TN). Each metric is just a different ratio of those four numbers, and each answers a different question. The table updates as you move the threshold.
What F1 leaves out. F1 ignores true negatives completely, and it treats a false positive and a false negative as equally costly. In real applications they rarely are (a missed tumour is not the same as a false alarm), so pick the metric, and the threshold, that matches your actual costs.
Lower the threshold and you catch more real positives (recall rises) but also raise more false alarms (precision usually falls). Raise it and the opposite happens. This is a tendency, not a strict rule: precision can wobble up or down from one threshold to the next, so look for bumps in the cyan line. F1 balances the two. Click the chart to try a threshold.
The ROC curve plots recall (true positive rate) against false positive rate for every possible threshold. The area under it, AUC, is the chance that a random positive scores higher than a random negative: 1.0 is perfect, and 0.5 is what random ranking gives on average. Switch to the precision-recall view to see how class imbalance changes the picture. Click a table row to move the threshold.
ROC-AUC summarizes how well a model ranks positive cases above negative cases across thresholds. It doesn’t depend on the selected threshold, but it doesn’t tell you which threshold is best for your application. When positives are rare, also examine the precision-recall curve and the cost of false positives and false negatives. A random-ranking classifier has an AUC of 0.5 in expectation; an individual model can score below 0.5.
Only 5% positives and a strict threshold. Accuracy looks great, but the model catches almost none of them.
A very low threshold flags nearly everything. Recall hits the top and precision collapses.
A very high threshold flags only sure things. Precision is high but many positives slip through.