Spaces:
Sleeping
Sleeping
Commit
·
6e0f5df
1
Parent(s):
c058232
fix: aggregate Global Leaderboard by model to prevent duplicates
Browse files
app.py
CHANGED
|
@@ -69,13 +69,13 @@ class LeaderboardManager:
|
|
| 69 |
# Calculate averages for numeric columns
|
| 70 |
model_aggregated = self.leaderboard.groupby('model_name')[numeric_columns].mean().reset_index()
|
| 71 |
|
| 72 |
-
# Sort by composite score
|
| 73 |
-
|
| 74 |
-
.sort_values('composite_score', ascending=False)
|
| 75 |
-
.head(n)
|
| 76 |
-
.reset_index(drop=True))
|
| 77 |
|
| 78 |
-
#
|
|
|
|
|
|
|
|
|
|
| 79 |
top_results.insert(0, 'rank', range(1, len(top_results) + 1))
|
| 80 |
|
| 81 |
# Reorder columns according to configuration
|
|
|
|
| 69 |
# Calculate averages for numeric columns
|
| 70 |
model_aggregated = self.leaderboard.groupby('model_name')[numeric_columns].mean().reset_index()
|
| 71 |
|
| 72 |
+
# Sort by composite score (descending) to get proper ranking
|
| 73 |
+
model_aggregated = model_aggregated.sort_values('composite_score', ascending=False).reset_index(drop=True)
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
+
# Take top N results
|
| 76 |
+
top_results = model_aggregated.head(n).copy()
|
| 77 |
+
|
| 78 |
+
# Add ranking column (1-based ranking)
|
| 79 |
top_results.insert(0, 'rank', range(1, len(top_results) + 1))
|
| 80 |
|
| 81 |
# Reorder columns according to configuration
|