Skip to content

Commit

Permalink
remove cases where emptyPred and emptyRef are both true as they skew …
Browse files Browse the repository at this point in the history
…the dice
  • Loading branch information
naga-karthik committed Jun 19, 2024
1 parent 76dbb55 commit 54ead73
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compute_metrics_reloaded.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,12 @@ def main():
# Convert JSON data to pandas DataFrame
df = build_output_dataframe(output_list)

# create a separate dataframe for columns where EmptyRef and EmptyPred is True
df_empty_masks = df[(df['EmptyRef'] == True) & (df['EmptyPred'] == True)]

# keep only the rows where either pred or ref is non-empty or both are non-empty
df = df[(df['EmptyRef'] == False) | (df['EmptyPred'] == False)]

# Compute mean and standard deviation of metrics across all subjects
df_mean = (df.drop(columns=['reference', 'prediction', 'EmptyRef', 'EmptyPred']).groupby('label').
agg(['mean', 'std']).reset_index())
Expand Down

0 comments on commit 54ead73

Please sign in to comment.