Skip to content

Commit 50afa55

Browse files
authored
Merge pull request #12 from ytchoutw/main
Change scoring to true negative rate
2 parents bbde2ee + 226dcf6 commit 50afa55

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

gw_challenge/scoring_program/scoring.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ def read_solution():
4545
return test_labels
4646

4747

48-
def save_score(FPR):
48+
def save_score(TNR):
4949
score_file = os.path.join(output_dir, 'scores.json')
5050

5151
scores = {
52-
'FPR': FPR,
52+
'TNR': TNR,
5353
}
5454
with open(score_file, 'w') as f_score:
5555
f_score.write(json.dumps(scores))
@@ -76,12 +76,12 @@ def main():
7676
tn = np.sum(np.logical_and(prediction == 0, solution == 0))
7777
fp = np.sum(np.logical_and(prediction == 1, solution == 0))
7878
fn = np.sum(np.logical_and(prediction == 0, solution == 1))
79-
FPR = fp / (fp + tn)
80-
print("FPR: ", FPR)
79+
TNR = tn / (fp + tn)
80+
print("TNR: ", TNR)
8181

8282
# Write Score
8383
print_pretty('Saving prediction')
84-
save_score(FPR)
84+
save_score(TNR)
8585

8686

8787
if __name__ == '__main__':

0 commit comments

Comments
 (0)