Skip to content

Commit

Permalink
Update report.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Delaunay authored Nov 16, 2024
1 parent a60a3aa commit 783a13b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions milabench/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 783a13b

Please sign in to comment.