A blood test gives each patient a score: higher means more likely sick. Write ranking_score(scores, sick): how good the test is at ranking sick patients above healthy ones, before anyone chooses a cutoff. sick[i] is 1 if patient i is sick and 0 if healthy. 1 means perfect, 0.5 a coin flip, 0 exactly backwards.
Four patients take the test. Ben and Ana are healthy, Cy and Di are sick. Lined up by score, how well did the test put the sick ones on top? Your function answers with one number.
ranking_score(scores, sick)| scores | the test's score for each patient, higher = more likely sick | e.g. [0.7, 0.8, 0.9, 0.95] |
| sick | 1 if that patient is sick, 0 if healthy | e.g. [0, 0, 1, 1] |
| returns | how well the scores rank sick above healthy: | |