[0f1df3]: / metrics / metrics_utils.py

Download this file

16 lines (15 with data), 462 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")