Skip to content
DeepForgeby svx
All problems
EasyStatisticsst-066

Type I and Type II Error Rates from Counts

Problem

Return [alpha, beta] from counts: alpha = fp/(fp+tn) is the false positive rate and beta = fn/(fn+tp) is the false negative rate. Return 0.0 for a ratio whose denominator is zero.

Hint

Alpha conditions on the true negatives and beta on the true positives.

Test cases

case 1
in: [90,10,10,90]
expected: [0.1,0.1]
case 2
in: [50,0,5,45]
expected: [0,0.09090909090909091]
case 3
in: [40,10,0,50]
expected: [0.16666666666666666,0]
case 4
in: [0,0,0,0]
expected: [0,0]
case 5
in: [80,20,20,80]
expected: [0.2,0.2]
Starter codePython
def type_error_rates(tp, fp, fn, tn):
    # Your code here
    pass

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