diff --git a/mu_map/training/random_search.py b/mu_map/training/random_search.py index 275b31651d7c7c058ae37a21e2081e6911b00406..0688ef39d3b25576302115b09a327d8e15ad74e7 100644 --- a/mu_map/training/random_search.py +++ b/mu_map/training/random_search.py @@ -236,6 +236,7 @@ def validate_and_make_directory(_dir: str): print(f"Directory {_dir} exists and is unexpectedly not empty!") exit(1) + def init_from_dir(_dir: str, logger: logging.Logger) -> Tuple[int, float]: last_run = os.listdir(_dir) # filter non-directories @@ -251,7 +252,9 @@ def init_from_dir(_dir: str, logger: logging.Logger) -> Tuple[int, float]: min_loss = pd.read_csv(os.path.join(_dir, "best", "measures.csv")) min_loss = min_loss["NMAE"].mean() - logger.info(f"Continue existing random search from run {last_run} and minimal NMAE {min_loss}") + logger.info( + f"Continue existing random search from run {last_run} and minimal NMAE {min_loss}" + ) return last_run + 1, min_loss