Commit 10eb22b0 authored by Joaquin Torres's avatar Joaquin Torres

Boxplots for cv metrics generated

parent 66deda66
......@@ -26,14 +26,23 @@ if __name__ == "__main__":
else:
model_names = model_names_simple
# Create figure for current sheet, one row per metric
fig, axes = plt.subplots(len(metric_names), 1, figsize=(15, 8 * len(metric_names)))
fig, axes = plt.subplots(len(metric_names), 1, figsize=(10, 10 * len(metric_names)))
for metric_id, metric_name in enumerate(metric_names):
# Get the axis for the current metric
ax = axes[metric_id]
# List to store the metric array for each model
metric_data = []
for model_name in model_names:
# Construct the row name
row_name = f'{model_name}_{metric_name}'
# Collect data for the current model's metric
metric_row = df.loc[df['Unnamed: 0'] == row_name].iloc[0, 1:].values
if group == 'pre' and method == '_ORIG' and metric_id == 0 and model_name == 'DT':
print(metric_row)
metric_data.append(metric_row)
# Plot boxplot for the current metric across all models
ax.boxplot(metric_data, labels=model_names)
ax.set_title(f'{metric_name} for {group}{method}')
plt.tight_layout()
fig.savefig(f'./output_cv_metrics/distributions/{group}{method}.svg', format='svg', dpi=600)
plt.close(fig) # Close the figure to free up memory
print("Succesful distribution plots generation")
# --------------------------------------------------------------------------------------------------------
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment