Commit 95044d19 authored by Nuno's avatar Nuno
Browse files

dl_config_paths

parent de96c601
Pipeline #837 passed with stage
in 36 minutes and 58 seconds
import sys
sys.path.append('../')
import pickle
from pathlib import Path
import os
......@@ -73,19 +71,19 @@ class DLConfig:
def create_model_folder(self):
if not os.path.exists('models'):
os.mkdir('models')
directory = Path('../pipelines/models/' + self.model_name)
directory = Path('models/' + self.model_name)
if not os.path.exists(directory):
os.mkdir(directory)
def set_model_id(self):
output_path = Path('../pipelines/models/' + self.model_name + '/' + 'results_'+ self.model_name + '.xlsx')
output_path = Path('models/' + self.model_name + '/' + 'results_'+ self.model_name + '.xlsx')
if os.path.exists(output_path):
reader = pd.read_excel(output_path)
self.model_id = self.model_name + '_' + str(len(reader))
else:
self.model_id = self.model_name + '_0'
self.model_id_path = Path('../pipelines/models/' + self.model_name + '/' + self.model_id)
self.model_id_path = Path('models/' + self.model_name + '/' + self.model_id)
if not os.path.exists(self.model_id_path):
os.mkdir(self.model_id_path)
......@@ -147,8 +145,6 @@ class DLConfig:
model = load_model(path)
return model
def save_data(self, x_train, y_train, x_val=None, y_val=None, path=None):
data = {'x_train': x_train, 'y_train':y_train,'x_val':x_val, 'y_val':y_val}
if path:
......
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