From c2d91e0bc7d7ec86e8ab83f379e74345214ca982 Mon Sep 17 00:00:00 2001 From: Greg DeVos Date: Fri, 4 Feb 2022 01:22:23 -0800 Subject: [PATCH] Fix/added unique ids to model_name (#760) * added unique ids to model_name * removed pid from the folder name Co-authored-by: Greg DeVos Co-authored-by: Julien Herzen --- darts/models/forecasting/forecasting_model.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/darts/models/forecasting/forecasting_model.py b/darts/models/forecasting/forecasting_model.py index 0226af903a..fb1d25ce3e 100644 --- a/darts/models/forecasting/forecasting_model.py +++ b/darts/models/forecasting/forecasting_model.py @@ -18,6 +18,7 @@ from random import sample import numpy as np import pandas as pd +import time from darts.timeseries import TimeSeries from darts.logging import get_logger, raise_log, raise_if_not, raise_if @@ -686,6 +687,12 @@ def _evaluate_combination(param_combination): param_combination_dict = dict( list(zip(parameters.keys(), param_combination)) ) + if param_combination_dict.get("model_name", None): + current_time = time.strftime("%Y-%m-%d_%H.%M.%S.%f", time.localtime()) + param_combination_dict[ + "model_name" + ] = f"{current_time}_{param_combination_dict['model_name']}" + model = model_class(**param_combination_dict) if use_fitted_values: # fitted value mode model._fit_wrapper(series, past_covariates, future_covariates)