All problems
Youden Index
Problem
Return the Youden index sensitivity + specificity - 1 for a diagnostic cutoff. It ranges from -1 to 1 and is 0 for an uninformative test.
Hint
Add the two rates and subtract one.
Test cases
case 1
in: [0.9,0.8]
expected: 0.7000000000000002
case 2
in: [1,1]
expected: 1
case 3
in: [0.5,0.5]
expected: 0
case 4
in: [0,0]
expected: -1
case 5
in: [0.8,0.9]
expected: 0.7000000000000002
Starter codePython
def youden_index(sensitivity, specificity):
# Your code here
pass5 test cases · run your code against them in the editor