set_validate.AutoTuner {mlr3tuning}R Documentation

Configure Validation for AutoTuner

Description

Configure validation for the final model fit (final_validate), as well as during the tuning (validate).

Usage

## S3 method for class 'AutoTuner'
set_validate(learner, validate, final_validate, ...)

Arguments

learner

(AutoTuner)
The autotuner for which to enable validation.

validate

(numeric(1), "predefined", "test", or NULL)
How to configure the validation during the hyperparameter tuning.

final_validate

(numeric(1), "predefined", "test" or NULL)
How to configure the validation during the final model fit. The default behavior is to not change the value. Rarely needed.

...

(any)
Passed when calling set_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

[Package mlr3tuning version 1.0.0 Index]