Calculate the false positive count from a confusion matrix and classification results.
False positives are negative cases incorrectly flagged as positive: FP = total_population × (1 − prevalence) × (1 − specificity). Here, (1 − prevalence) gives the number of truly negative cases, and (1 − specificity) is the false positive rate — the fraction of true negatives the test incorrectly calls positive. This is the classic 'false alarm' count, and it's why even highly specific tests can generate large numbers of false positives when screening a population where the condition is rare.
FP = total * (1 - prevalence) * (1 - specificity)
When a condition is rare, the number of true negatives in the population is very large, so even a small false-positive rate (1 − specificity) applied to that large group produces a substantial absolute number of false positives — this is the basis of the 'base rate fallacy'.
Precision = TP / (TP + FP), so a large FP count directly drags down precision even if the model correctly identifies most true positives, especially when the positive class is rare relative to the negative class.
Specificity = TN / (TN + FP), so FP and specificity move in opposite directions — as specificity increases (fewer false alarms per true negative), FP count decreases for a fixed number of actual negatives.