Skip to content

Commit

Permalink
Fix script compiling scores to avoid merging different metrics together
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanpainchaud committed Jul 2, 2024
1 parent 1b5a6ad commit 4850e26
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions didactic/scripts/compile_prediction_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ def compile_prediction_scores(
Returns:
Table of the scores aggregated over all the models.
"""
agg_scores_by_model = [scores.loc[scores_to_agg].dropna(axis="columns") for scores in prediction_scores]
agg_scores = pd.concat(agg_scores_by_model).astype(float).describe()
agg_scores = agg_scores.loc[agg_functions]
# Filter prediction scores to only include the scores to aggregate
scores_by_prediction = {
idx: scores.loc[scores_to_agg].dropna(axis="columns") for idx, scores in enumerate(prediction_scores)
}
scores_by_prediction = pd.concat(scores_by_prediction).astype(float).unstack()

# Compute descriptive statistics for the scores and only keep the ones of interest
agg_scores = scores_by_prediction.describe().loc[agg_functions]

return agg_scores


Expand Down

0 comments on commit 4850e26

Please sign in to comment.