mlr3
mlr3 copied to clipboard
implement hotstart for learners
Proposal
When hotstarting, a learner reuses a previously fitted model while training e.g. adding trees to a random forest.
HotstartStack
stores trained learners which can be potentially used to
hot start a learner. Learner automatically hot start while training if a
stack is attached to the $hotstart_stack
field and the stack contains a
suitable learner.
resample()
and benchmark()
make use of hotstarting. This allows to easily use hotstarting in mlr3tuning. Grid search is sorted by hotstart parameter and hyperband directly supports it.
Hot starting is only supported by learners which have the property
"hotstart_forward"
or "hotstart_backward"
. For example, an xgboost model can hot start forward by adding more boosting iterations and a random forest can go backwards by removing trees. The fidelity parameters are tagged with "hotstart"
in learner's parameter set.
I found HotstartStack
class in mlr3
and LearnerClassifXgboost$private_methods$.hotstart()
method in mlr3learners
after my unsuccessful attempts to implement early stopping.
Is it possible to use such functionality during model tuning, i.e. in tuner$optimize()
? It would be extremely convenient to train xgboost
models with 100, 200, 300, ... 1000 trees by building 1000 trees in total instead of building 100+200+300+...+1000 trees.
@be-marc has a quite sophisticated take on this since some weeks - maybe he can share the current status so that you could build upon this or even contribute?
Yes but we are not quite there yet. You can install the mlr3tuning
development version from GitHub and use TunerGridSearch
with hotstarting. The grid is sorted by the hotstart parameter and the models are hotstarted from previously fitted models. You can also use TunerHyperband
from mlr3hyperband
which discards low performing hyperparameter configurations and hotstarts the promising configurations.
@be-marc can we close here?