Closed Shitao5 closed 1 year ago
When I use the term_evals parameter, everything works fine:
term_evals
rr = tune_nested( tuner = tnr("random_search", batch_size = 2), task = tsk("penguins"), learner = lrn("classif.rpart", cp = to_tune(1e-04, 1e-1, logscale = TRUE)), inner_resampling = rsmp ("holdout"), outer_resampling = rsmp("cv", folds = 2), measure = msr("classif.ce"), term_evals = 2) #> INFO [14:53:22.586] [mlr3] Applying learner 'classif.rpart.tuned' on task 'penguins' (iter 1/2) #> INFO [14:53:22.645] [bbotk] Starting to optimize 1 parameter(s) with '<OptimizerRandomSearch>' and '<TerminatorEvals> [n_evals=2, k=0]'
But when I use terminator = trm("evals", n_evals = 2) instead of term_evals = 2, the termination condition becomes ineffective:
terminator = trm("evals", n_evals = 2)
term_evals = 2
rr = tune_nested( tuner = tnr("random_search", batch_size = 2), task = tsk("penguins"), learner = lrn("classif.rpart", cp = to_tune(1e-04, 1e-1, logscale = TRUE)), inner_resampling = rsmp ("holdout"), outer_resampling = rsmp("cv", folds = 2), measure = msr("classif.ce"), terminator = trm("evals", n_evals = 2)) #> INFO [14:55:17.550] [mlr3] Applying learner 'classif.rpart.tuned' on task 'penguins' (iter 1/2) #> INFO [14:55:17.691] [bbotk] Starting to optimize 1 parameter(s) with '<OptimizerRandomSearch>' and '<TerminatorNone>'
My mlr3tuning package version is 0.19.0.
mlr3tuning
0.19.0
Thanks for reporting. Fixed in #397.
When I use the
term_evals
parameter, everything works fine:But when I use
terminator = trm("evals", n_evals = 2)
instead ofterm_evals = 2
, the termination condition becomes ineffective:My
mlr3tuning
package version is0.19.0
.