Specificity and True Negative Rate
What you'll learn: How specificity measures your model's ability to correctly identify negative cases, just as recall measures its ability to identify positive cases.
The Flip Side of Recall
You've learned that recall (or sensitivity) tells you: "Of all actual positives, how many did I catch?"
Specificity asks the mirror question: "Of all actual negatives, how many did I correctly identify as negative?"
Specificity is literally the recall equivalent for the negative class. It's calculated from the confusion matrix as:
Specificity = True Negatives / (True Negatives + False Positives)
Or equivalently:
Specificity = TN / (TN + FP) = TN / All Actual Negatives
Why It Matters
Imagine a medical test for a rare disease. High recall ensures you catch most sick patients (few false negatives). But what about healthy people?
Specificity tells you how well your model avoids false alarms. A model with 95% specificity correctly identifies 95% of healthy patients as healthy, only misclassifying 5% as sick (false positives).
In fraud detection, high specificity means legitimate transactions aren't incorrectly flagged. In spam filtering, it means real emails reach your inbox.
The Trade-off
Just like precision and recall, there's often a trade-off: making your model more cautious (higher specificity) might cause it to miss some positives (lower recall). Understanding both metrics gives you a complete picture of your classifier's behavior on both classes.
Key Takeaway: Specificity measures how well your model correctly identifies negative cases—it's the true negative rate, answering "what percentage of actual negatives did I classify correctly?"