Skip to content

Commit

Permalink
feat(Evaluation): Added returning merged and gain dataframe in Compar…
Browse files Browse the repository at this point in the history
…ison Evaluation
  • Loading branch information
muellerdo committed Jun 4, 2022
1 parent f0e9678 commit c2c1a33
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions aucmedi/evaluation/comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def evaluate_comparison(pred_list,
suffix (str): Special suffix to add in the created figure filename.
Returns:
metrics (pandas.DataFrame): Dataframe containing all computed metrics (except ROC).
df_merged (pandas.DataFrame): Dataframe containing the merged metrics of all models.
df_gain (pandas.DataFrame): Dataframe containing performance gain compared to first model.
"""
# Identify number of labels
n_labels = labels.shape[-1]
Expand Down Expand Up @@ -159,7 +160,10 @@ def evaluate_comparison(pred_list,
evalby_beside(df_merged, out_path, suffix)

# Generate comparison gain plot
evalby_gain(df_merged, out_path, suffix)
df_gain = evalby_gain(df_merged, out_path, suffix)

# Return combined and gain dataframe
return df_merged, df_gain

#-----------------------------------------------------#
# Evaluation Comparison - Beside #
Expand Down Expand Up @@ -259,3 +263,6 @@ def compute_gain(row, template):
if suffix is not None : filename += "." + str(suffix)
filename += ".png"
fig.save(filename=filename, path=out_path, width=18, height=9, dpi=300)

# Return gain dataframe
return df

0 comments on commit c2c1a33

Please sign in to comment.