Wei Lin
commited on
Commit
·
0dc8e8d
1
Parent(s):
69b2e47
modify metric function
Browse files
metric.py
CHANGED
|
@@ -522,8 +522,8 @@ def compute(params):
|
|
| 522 |
public_category_score_dict = {}
|
| 523 |
private_category_score_dict = {}
|
| 524 |
for key_ in all_keys:
|
| 525 |
-
public_category_score_dict.update({key_:
|
| 526 |
-
private_category_score_dict.update({key_:
|
| 527 |
|
| 528 |
############################################# Check if all the sample ids are in the submission file ########################################################################################
|
| 529 |
missing_sample_ids = []
|
|
@@ -533,7 +533,19 @@ def compute(params):
|
|
| 533 |
missing_sample_ids.append(sample_id)
|
| 534 |
if len(missing_sample_ids) > 0:
|
| 535 |
print(f'Error: missing sample ids in the submission file: {missing_sample_ids}')
|
| 536 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 537 |
|
| 538 |
###################################################################################################################################################
|
| 539 |
############################################# phase 1 eval (only acc) ########################################################################################
|
|
|
|
| 522 |
public_category_score_dict = {}
|
| 523 |
private_category_score_dict = {}
|
| 524 |
for key_ in all_keys:
|
| 525 |
+
public_category_score_dict.update({key_: -1})
|
| 526 |
+
private_category_score_dict.update({key_: -1})
|
| 527 |
|
| 528 |
############################################# Check if all the sample ids are in the submission file ########################################################################################
|
| 529 |
missing_sample_ids = []
|
|
|
|
| 533 |
missing_sample_ids.append(sample_id)
|
| 534 |
if len(missing_sample_ids) > 0:
|
| 535 |
print(f'Error: missing sample ids in the submission file: {missing_sample_ids}')
|
| 536 |
+
|
| 537 |
+
metric_dict = {"public_score": public_category_score_dict,
|
| 538 |
+
"private_score": private_category_score_dict} # keys of public_score, private_score is a must
|
| 539 |
+
del public_category_score_dict['mydoc_rating']
|
| 540 |
+
del public_category_score_dict['mychart_rating']
|
| 541 |
+
del public_category_score_dict['myinfographic_rating']
|
| 542 |
+
del public_category_score_dict['phase2_overall_rating']
|
| 543 |
+
|
| 544 |
+
del private_category_score_dict['mydoc_rating']
|
| 545 |
+
del private_category_score_dict['mychart_rating']
|
| 546 |
+
del private_category_score_dict['myinfographic_rating']
|
| 547 |
+
del private_category_score_dict['phase2_overall_rating']
|
| 548 |
+
return metric_dict
|
| 549 |
|
| 550 |
###################################################################################################################################################
|
| 551 |
############################################# phase 1 eval (only acc) ########################################################################################
|