Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions autosklearn/automl.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,19 +751,21 @@ def fit(
if proc_ensemble is not None:
self.ensemble_performance_history = list(proc_ensemble.history)

# save the ensemble performance history file
if len(self.ensemble_performance_history) > 0:
pd.DataFrame(self.ensemble_performance_history).to_json(
os.path.join(self._backend.internals_directory, 'ensemble_history.json'))

if len(proc_ensemble.futures) > 0:
future = proc_ensemble.futures.pop()
# Now we need to wait for the future to return as it cannot be cancelled while it
# is running: https://stackoverflow.com/a/49203129
self._logger.info("Ensemble script still running, waiting for it to finish.")
future.result()
result = proc_ensemble.futures.pop().result()
if result:
ensemble_history, _, _, _, _ = result
self.ensemble_performance_history.extend(ensemble_history)
self._logger.info("Ensemble script finished, continue shutdown.")

# save the ensemble performance history file
if len(self.ensemble_performance_history) > 0:
pd.DataFrame(self.ensemble_performance_history).to_json(
os.path.join(self._backend.internals_directory, 'ensemble_history.json'))

if load_models:
self._logger.info("Loading models...")
self._load_models()
Expand Down