Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enables fitting an ensemble after
search
has finished. It also fixes issue #299.Types of changes
Note that a Pull Request should only contain one of refactoring, new features or documentation changes.
Please separate these changes and send us individual PRs for each.
For more information on how to create a good pull request, please refer to The anatomy of a perfect pull request.
Checklist:
Description
This PR adds a function called
fit_ensemble
which can create an ensemble aftersearch
has finished. It uses the same backend working directory as the search and builds an ensemble based on the predictions of models saved duringsearch
. Also, as ensemble creation is now a separate process, it does not make sense to instantiate a task tied with anensemble_size
andensemble_nbest
. Therefore, these parameters are no longer class parameters, instead, they are passed to thesearch
function orfit_ensemble
function.Additionally, as raised in #299 we raise a warning that ensemble could not be built regardless if the user did not want it in the first place.
Motivation and Context
This PR enables the ability to fit an ensemble post hoc. This enables the ability to create multiple ensembles with the same algorithms found in search, it can also save time in the search by removing the overhead with fitting the ensemble as it is passed as a callback to smac. Moreover, in the future, we can also enable creating an ensembles stored in disk with a new task object.
How has this been tested?
As ensemble fitting was already being tested in the
test_api
, I have added tests to a new function_init_ensemble_builder
. Moreover, with the posthot_ensemble_fit example, it ensures a smooth function of search withensemble_size=0
.