Skip to content
DeepForgeby svx
All problems
EasyStatisticsst-409

False Positive Rate from Counts

Problem

The false positive rate is FP / (FP + TN), equal to 1 minus specificity. Return 0.0 when the denominator is zero.

Given the counts, return the rate.

Hint

It is the complement of specificity.

Test cases

case 1
in: [1,9]
expected: 0.1
case 2
in: [5,5]
expected: 0.5
case 3
in: [0,4]
expected: 0
Starter codePython
def false_positive_rate_from_counts(fp, tn):
    # Your code here
    pass

3 test cases · run your code against them in the editor