Configure validation for the final model fit (final_validate
), as well as
during the tuning (validate
).
Usage
# S3 method for AutoTuner
set_validate(learner, validate, final_validate, ...)
Arguments
- learner
(
AutoTuner
)
The autotuner for which to enable validation.- validate
(
numeric(1)
,"predefined"
,"test"
, orNULL
)
How to configure the validation during the hyperparameter tuning.- final_validate
(
numeric(1)
,"predefined"
,"test"
orNULL
)
How to configure the validation during the final model fit. The default behavior is to not change the value. Rarely needed.- ...
(any)
Passed when callingset_validate()
on the wrapped leaerner.
Examples
at = auto_tuner(
tuner = tnr("random_search"),
learner = lrn("classif.debug", early_stopping = TRUE,
iter = to_tune(upper = 1000L, internal = TRUE), validate = 0.2),
resampling = rsmp("holdout")
)
# use the test set as validation data during tuning
set_validate(at, validate = "test")
at$learner$validate
#> [1] "test"