From 84a56e79065202403a0a8f2444ee104e0494c4f2 Mon Sep 17 00:00:00 2001 From: William Qi Date: Mon, 18 Apr 2022 04:35:18 -0400 Subject: [PATCH] Sort DF by probability when loading from parquet --- src/av2/datasets/motion_forecasting/eval/submission.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/av2/datasets/motion_forecasting/eval/submission.py b/src/av2/datasets/motion_forecasting/eval/submission.py index 72399037b..dab295c93 100644 --- a/src/av2/datasets/motion_forecasting/eval/submission.py +++ b/src/av2/datasets/motion_forecasting/eval/submission.py @@ -88,6 +88,7 @@ def from_parquet(cls, submission_file_path: Path) -> ChallengeSubmission: """ # Load submission data and sort rows by descending probability submission_df = pd.read_parquet(submission_file_path) + submission_df.sort_values(by="probability", inplace=True, ascending=False) # From serialized data, build scenario-track mapping for predictions submission_dict: Dict[str, ScenarioPredictions] = defaultdict(lambda: defaultdict(dict)) # type: ignore