Skip to content

Commit

Permalink
Compute mean and standard deviation of metrics across all subjects
Browse files Browse the repository at this point in the history
  • Loading branch information
valosekj committed Feb 29, 2024
1 parent b7a4b7a commit 03a1e27
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions compute_metrics/compute_metrics_reloaded.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ def main():
df.to_csv(fname_output_csv, index=False)
print(f'Saved metrics to {fname_output_csv}.')

# 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())

# save as CSV
fname_output_csv_mean = os.path.abspath(args.output.replace('.csv', '_mean.csv'))
df_mean.to_csv(fname_output_csv_mean, index=False)
print(f'Saved mean and standard deviation of metrics across all subjects to {fname_output_csv_mean}.')


if __name__ == '__main__':
main()

0 comments on commit 03a1e27

Please sign in to comment.