How are Precision and Recall Calculated?
Calculating precision and recall is actually quite easy. Imagine there are 100 positive cases among 10,000 cases. You want to predict which ones ore positive, and you pick 200 to have a better chance of catching many of the 100 positive cases. You record the IDs of your predictions, and when you get the actual results and tally up how many times you were right or wrong. There are four ways of being right or wrong:
- TN / True Negative: case was negative and predicted negative
- TP / True Positive: case was positive and predicted positive
- FN / False Negative: case was positive but predicted negative
- FP / False Positive: case was positive but predicted negative
Makes sense so far? Now you count how many of the 10,000 cases fall in each bucket, say:
|
|
Predicted Negative
|
Predicted Positive
|
|
Negative Cases
|
TN: 9,760
|
FP: 140
|
|
Positive Cases
|
FN: 40
|
TP: 60
|
Now, your boss asks you three questions:
- How many percent of your predictions were correct?
You answer: the "accuracy" was (9,760+60) out of 10,000 = 98.2%
- How many percent of the positive cases did you catch?
You answer: the "recall" was 60 out of 100 = 60%
- How many percent of positive predictions were correct?
You answer: the "precision" was 60 out of 200 = 30%
Posted at
10:28AM Jan 10, 2006
by tilmannsblog in The Predictive Business |