|
import pandas as pd |
|
|
|
|
|
df = pd.read_csv("/fsx/loubna/code/code-leaderboard/starcoder-models-eval/raw_scores.csv") |
|
|
|
|
|
print(df.iloc[:, 5:-2]) |
|
df.insert(2, "Average score", df.iloc[:, 5:-2].mean(axis=1).round(2)) |
|
|
|
|
|
old_size = len(df.columns) |
|
|
|
for col in df.columns[6:-2]: |
|
df[col + " rank"] = df[col].rank(ascending=False) |
|
df[col + " rank"] = len(df) - (df[col + " rank"] - 1) |
|
df["Win Rate"] = df.iloc[:, old_size:].mean(axis=1).round(2) |
|
df = df.drop(df.columns[old_size:-1], axis=1) |
|
df = df[["Models", "Size (B)", "Win Rate"] + df.columns[2:-1].tolist()] |
|
|
|
|
|
df = df.sort_values(by=["Win Rate"], ascending=False) |
|
print(f"len df is {len(df)}") |
|
print(df) |
|
|
|
df.to_csv("/fsx/loubna/code/code-leaderboard/starcoder-models-eval/code_eval_board.csv", index=False) |
|
|
|
print(df.iloc[:, :10]) |