Lisa Dunlap commited on
Commit
f61ae52
β€’
1 Parent(s): e022a14

reverted to tie-based ranking

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -220,20 +220,20 @@ def create_ranking_str(ranking, ranking_difference):
220
  return f"{int(ranking)}"
221
 
222
  def get_arena_table(arena_df, model_table_df, arena_subset_df=None):
223
- arena_df = arena_df.sort_values(by=["rating"], ascending=False)
224
- # arena_df = arena_df.sort_values(by=["final_ranking"], ascending=True)
225
  arena_df = arena_df[arena_df["num_battles"] > 2000]
226
 
227
- arena_df["final_ranking"] = range(1, len(arena_df) + 1)
228
  # sort by rating
229
  if arena_subset_df is not None:
230
  # filter out models not in the arena_df
231
  arena_subset_df = arena_subset_df[arena_subset_df.index.isin(arena_df.index)]
232
- arena_subset_df = arena_subset_df.sort_values(by=["rating"], ascending=False)
233
- # arena_subset_df = arena_subset_df.sort_values(by=["final_ranking"], ascending=True)
234
 
235
  # assign ranking by the order
236
- arena_subset_df["final_ranking"] = range(1, len(arena_subset_df) + 1)
237
  # join arena_df and arena_subset_df on index
238
  arena_df = arena_subset_df.join(arena_df["final_ranking"], rsuffix="_global", how="inner")
239
  arena_df['ranking_difference'] = arena_df['final_ranking_global'] - arena_df['final_ranking']
 
220
  return f"{int(ranking)}"
221
 
222
  def get_arena_table(arena_df, model_table_df, arena_subset_df=None):
223
+ # arena_df = arena_df.sort_values(by=["rating"], ascending=False)
224
+ arena_df = arena_df.sort_values(by=["final_ranking"], ascending=True)
225
  arena_df = arena_df[arena_df["num_battles"] > 2000]
226
 
227
+ # arena_df["final_ranking"] = range(1, len(arena_df) + 1)
228
  # sort by rating
229
  if arena_subset_df is not None:
230
  # filter out models not in the arena_df
231
  arena_subset_df = arena_subset_df[arena_subset_df.index.isin(arena_df.index)]
232
+ # arena_subset_df = arena_subset_df.sort_values(by=["rating"], ascending=False)
233
+ arena_subset_df = arena_subset_df.sort_values(by=["final_ranking"], ascending=True)
234
 
235
  # assign ranking by the order
236
+ # arena_subset_df["final_ranking"] = range(1, len(arena_subset_df) + 1)
237
  # join arena_df and arena_subset_df on index
238
  arena_df = arena_subset_df.join(arena_df["final_ranking"], rsuffix="_global", how="inner")
239
  arena_df['ranking_difference'] = arena_df['final_ranking_global'] - arena_df['final_ranking']