From 783a13b4bd87db7fad8e848191a18557c40b6eb5 Mon Sep 17 00:00:00 2001 From: Setepenre Date: Sat, 16 Nov 2024 13:06:45 -0500 Subject: [PATCH] Update report.py --- milabench/report.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/milabench/report.py b/milabench/report.py index c54ed8dd..da68c80a 100644 --- a/milabench/report.py +++ b/milabench/report.py @@ -417,12 +417,17 @@ def _score(column): # This computes a weighted geometric mean # perf can be object np.float64 !? - perf = df[column].astype(float) + # success_ratio = 1 - row["fail"] / max(row["n"], 1) + + # score = (acc if acc > 0 else row["perf"]) * success_ratio + score = df[column].astype(float) weights = df["weight"] * df["enabled"].astype(int) - weight_total = np.sum(weights) + # if total weight is 0 ? + weight_total = np.sum(weights) - logscore = np.sum(np.log(perf) * weights) / weight_total + # score cannot be 0 + logscore = np.sum(np.log(score + 1) * weights) / weight_total return np.exp(logscore) except ZeroDivisionError: return 0