Learn R Programming

mlr3tuning (version 1.5.1)

set_validate.AutoTuner: Configure Validation for AutoTuner

Description

Configure validation data for the learner that is tuned by the AutoTuner.

Usage

# S3 method for AutoTuner
set_validate(learner, 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.

...

(any)
Passed when calling set_validate() on the wrapped leaerner.

Examples

Run this code
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

Run the code above in your browser using DataLab