Download this file

15 lines (15 with data), 455 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
def check_metric_is_better(cur_best, main_metric, score, task):
if task=="los":
if cur_best=={}:
return True
if score < cur_best[main_metric]:
return True
return False
elif task in ["outcome", "multitask"]:
if cur_best=={}:
return True
if score > cur_best[main_metric]:
return True
return False
else:
raise ValueError("Task not supported")