True Positive Rate (Sensitivity) Calculator
What is the True Positive Rate?
The True Positive Rate (TPR), also known as Sensitivity or Recall, is a critical metric in statistics, machine learning, and medical testing. It measures the proportion of actual positive cases that were correctly identified by a test or model. In simpler terms, it answers the question: "Of all the people who actually have the condition, how many did the test correctly catch?"
The Mathematical Formula
Calculating the TPR requires data from a confusion matrix. You need to know the number of True Positives (cases correctly identified as positive) and False Negatives (actual positive cases that the test missed).
How to Interpret Results
- TPR = 1.0 (100%): The test is perfect at identifying positive cases. There are no False Negatives.
- High TPR: The test is highly sensitive. It is excellent for screening because it rarely misses a positive case.
- Low TPR: The test is "leaky." Many positive cases are going undetected (Type II Error).
Realistic Example: Cancer Screening
Imagine a medical study for a new diagnostic test involving 100 patients who actually have a specific disease:
- The test correctly identifies 92 patients (True Positives = 92).
- The test misses 8 patients, incorrectly telling them they are healthy (False Negatives = 8).
Calculation: 92 / (92 + 8) = 0.92
The True Positive Rate (Sensitivity) is 92%.
Why TPR Matters in Machine Learning
In binary classification, looking at accuracy alone can be misleading, especially with imbalanced datasets. If you are building a fraud detection system where only 1% of transactions are fraudulent, a model that labels everything as "not fraud" will be 99% accurate but have a 0% True Positive Rate. In high-stakes environments like medicine or security, maximizing TPR is often more important than maximizing overall accuracy.