This function creates a named list of settings which control the execution of an Experiment.

  • store_model: If FALSE, the model returned by the learner is discarded in order to save some memory after the experiment is completed. Note that you will be unable to further predict on new data.

  • store_prediction: If FALSE, the predictions are discarded in order to save some memory after the experiment is completed.

  • encapsulate_train: How to call external code in third party packages during train.

    • If set to "none" (default), the code is executed in the running session without error handling. Output is not stored, just send to the console.

    • If set to "evaluate", the exceptions are caught using evaluate::evaluate(), and output is stored in a Log of the corresponding Experiment.

    • If set to "callr", the code is executed in an independent R session. This guards your session from segfaults, at the cost of some computational overhead. Logs are also stored in the Experiment.

    See Log for an example.

  • encapsulate_predict: How to call external code in third party packages during predict. Same format as encapsulate_train. See Log for an example.

mlr_control(...)

Arguments

...

Named arguments to overwrite the defaults / options.

Value

(named list()). If no argument is provided, returns all settings as named list. If arguments are provided in a name = value fashion, the settings are returned as named list after some argument checks.

Examples

# get a list of the defaults mlr_control()
#> $store_model #> [1] TRUE #> #> $store_prediction #> [1] TRUE #> #> $encapsulate_train #> [1] "none" #> #> $encapsulate_predict #> [1] "none" #> #> $log_threshold #> [1] 400 #> attr(,"level") #> [1] "INFO" #> attr(,"class") #> [1] "loglevel" "integer" #>
# get a control object, with the default of store_model changed to FALSE mlr_control(store_model = FALSE)
#> $store_model #> [1] FALSE #> #> $store_prediction #> [1] TRUE #> #> $encapsulate_train #> [1] "none" #> #> $encapsulate_predict #> [1] "none" #> #> $log_threshold #> [1] 400 #> attr(,"level") #> [1] "INFO" #> attr(,"class") #> [1] "loglevel" "integer" #>