How it works
Precision = TP / (TP + FP), while recall = TP / (TP + FN). Precision asks how many positive predictions were correct; recall asks how many actual positives were found.
A concrete example
If 8 predictions are true positives and 2 are false positives, precision is 8 / 10 = 80%. If 2 actual positives were missed, recall is also 8 / 10 = 80%.
Watch for this
When a denominator is zero the metric is undefined. Report that case explicitly instead of silently treating it as a meaningful score.
Try it yourself
Change each count and explain which error affects precision or recall.