diff --git a/image_processing/build_dataset.py b/image_processing/build_dataset.py index d2820b2881acdf283333f9756fd71ff63478328c..0460fd4978a357da527d8a03acac781aee9f8ec7 100644 --- a/image_processing/build_dataset.py +++ b/image_processing/build_dataset.py @@ -145,7 +145,7 @@ def create_antibio_dataset(path='../data/label_raw/230804_strain_peptides_antibi l = split_before_number(s) species = l[0] nb = l[1] - return '{}-{}-{}{}.mzML'.format(species,nb,analyse,suffix) + return f'{species}-{nb}-{analyse}{suffix}.mzML' df['path_ana'] = df['sample_name'].map(lambda x: create_fname(x,analyse='ANA')) df['path_aer'] = df['sample_name'].map(lambda x: create_fname(x, analyse='AER')) @@ -172,8 +172,8 @@ def create_dataset(): name = label[label['path_aer'] == path.split("/")[-1]]['sample_name'].values[0] analyse = 'AER' if species is not None: #save image in species specific dir - directory_path_png = '../data/processed_data/png_image/{}'.format(species) - directory_path_npy = '../data/processed_data/npy_image/{}'.format(species) + directory_path_png = f'../data/processed_data/png_image/{species}' + directory_path_npy = f'../data/processed_data/npy_image/{species}' if not os.path.isdir(directory_path_png): os.makedirs(directory_path_png) if not os.path.isdir(directory_path_npy): diff --git a/main.py b/main.py index 91a64cee648247584d77ae12a5b6fa4832dfb2cb..d9d63da237ab78b1b557feb8c7f1d2196c187f37 100644 --- a/main.py +++ b/main.py @@ -11,6 +11,7 @@ from sklearn.metrics import confusion_matrix import seaborn as sn import pandas as pd +#test modif git def train(model, data_train, optimizer, loss_function, epoch):