loubnabnl's picture
loubnabnl HF staff
update codegeex scores
5128d5f
raw
history blame
894 Bytes
import pandas as pd
df = pd.read_csv("/fsx/loubna/code/code-leaderboard/starcoder-models-eval/raw_scores.csv")
# average score
print(df.iloc[:, 5:-2])
df.insert(2, "Average score", df.iloc[:, 5:-2].mean(axis=1).round(2))
# add win rate columns for each language
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()]
# sort with regard to column win rate
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 first 10 cols
print(df.iloc[:, :10])