When I want to set a hyperparameter of a model that depends on another, how can I specify in the case that the dependency is not met to assign a specific value, e.g. in the example below I would like to have num.random.splits = 1 instead of NA (which gives me a warning when I train the learner later):
library(mlr3extralearners)
library(paradox)
learner = lrn('surv.ranger',
splitrule = to_tune(c('logrank', 'extratrees', 'C', 'maxstat')),
num.random.splits = to_tune(p_int(1, 100, depends = splitrule == 'extratrees')))
generate_design_random(learner$param_set$search_space(), 5)
#> <Design> with 5 rows:
#> splitrule num.random.splits
#> 1: C NA
#> 2: extratrees 13
#> 3: extratrees 52
#> 4: logrank NA
#> 5: C NA
Hi!
When I want to set a hyperparameter of a model that depends on another, how can I specify in the case that the dependency is not met to assign a specific value, e.g. in the example below I would like to have
num.random.splits
= 1 instead ofNA
(which gives me a warning when I train the learner later):Created on 2022-06-08 by the reprex package (v2.0.1)