Commit 12b3447b authored by Alessia Marcolini's avatar Alessia Marcolini
Browse files

comment magics and add pandas

parent cc494d23
......@@ -8,8 +8,8 @@
# In[ ]:
get_ipython().run_line_magic('reload_ext', 'autoreload')
get_ipython().run_line_magic('autoreload', '2')
# get_ipython().run_line_magic('reload_ext', 'autoreload')
# get_ipython().run_line_magic('autoreload', '2')
import os
PATH = os.getcwd()
......@@ -28,6 +28,7 @@ import sys
import time
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.metrics import matthews_corrcoef as mcor, accuracy_score as acc, recall_score as recall, precision_score as precision, confusion_matrix
import torch
......@@ -80,7 +81,7 @@ settings = {
'pretrained': '',
}
assert settings['split'] in ['valeries', '8020']
assert settings['split'] in ['valieres', '8020']
assert settings['pretrained'] in ['Med3D', 'branch-wise', 'T-stage', '']
os.makedirs(f'{EXPERIMENT_DIR}/{EXPERIMENT_NAME}', exist_ok=False)
......@@ -540,8 +541,6 @@ np.save(f'{EXPERIMENT_DIR}/{EXPERIMENT_NAME}/filenames_ts.npy', filenames_ts)
# In[ ]:
import pandas as pd
metrics_out = pd.DataFrame((train_metrics, test_metrics), columns=['MCC', 'ACC', 'prec', 'rec'], index = ['train','test'])
metrics_out.to_csv(f'{EXPERIMENT_DIR}/{EXPERIMENT_NAME}/metrics_out.csv', index=False)
......
Supports Markdown
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