We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f9d28a9 commit 5aa7857Copy full SHA for 5aa7857
py_css/interface/kaggle.py
@@ -27,8 +27,8 @@ def to_kaggle_format(df: pd.DataFrame) -> str:
27
str
28
The dataframe in the Kaggle submission format.
29
"""
30
- # for each query, only keep the best 3 docnos
31
- df = df.groupby("qid").head(3)
+ # for each query, only keep the best 3 docnos ranked by asceding rank
+ df = df.groupby("qid").sort_values("rank").head(3)
32
33
output = "qid,docid\n"
34
for _, row in df.iterrows():
0 commit comments