The LearnerRegrAuto is an automated machine learning (AutoML) system for regression tasks. It combines preprocessing, a switch between multiple learners, and hyperparameter tuning to find the best model for the given task.
Value
Object of class R6::R6Class and LearnerRegrAuto.
Debugging
Set options(bbotk.debug = TRUE) to run the tuning in the main session.
Set encapsulate_learner = FALSE to remove encapsulation of the learner.
Set encapsulate_mbo = FALSE to catch no errors in mbo.
Parameters
- learner_timeout
(
integer(1))
Timeout for training and predicting with a single learner.- n_threads
(
integer(1))
Number of threads used for training a single learner.- memory_limit
(
integer(1))
Memory limit for training a single learner in MB. The limit is shared across the parallel workers, i.e. divided by the number of workers.- devices
(
character())
Devices to use for model training. Possible values are"cpu"and"cuda". If"cuda", the learner will be trained on a GPU.- large_data_size
(
integer(1))
Threshold for the data set size (number of rows times number of columns) above which large-data rules apply. Beyond this threshold the number of parallel workers is reduced and each remaining worker is given proportionally more threads and memory.- small_data_size
(
integer(1))
Threshold value for the data set size from which special rules apply.- small_data_resampling
(mlr3::Resampling)
Resampling strategy to use for model training on small data sets.- initial_design_default
(
logical(1))
Whether to use the default design of the learner.- initial_design_set
(
integer(1))
Number of points to use for the initial design set.- initial_design_size
(
integer(1))
Size of the random, sobol or lhs initial design.- initial_design_type
(
character(1))
Type of the initial design used for mbo. Possible values are"lhs","sobol","random"."lhs"uses a Latin Hypercube Sampling design."sobol"uses a Sobol sequence design."random"uses a random design.- initial_design_fraction
(
numeric(1))
Fraction of the budget to use for the initial design.- resampling
(mlr3::Resampling)
Resampling strategy used for tuning.- terminator
(bbotk::Terminator)
Terminator criterion for tuning.- measure
(mlr3::Measure)
Measure used for tuning.- callbacks
(mlr3tuning::CallbackAsyncTuning)
Callbacks used for tuning.- store_benchmark_result
(
logical(1))
Whether to store the benchmark result.- store_models
(
logical(1))
Whether to store the models.- encapsulate_learner
(
logical(1))
Whether to encapsulate the learner. Change toFALSEto debug.- encapsulate_mbo
(
logical(1))
Whether to encapsulate the tuning. Change toFALSEto debug.- check_learners
(
logical(1))
Whether to check if the learners are compatible with the task. Change toFALSEto debug.
Python learners
Python learners like TabPFN and fastai run via reticulate and
therefore need a Python installation with their required packages.
There are two ways to provide it:
Do nothing and let
reticulate::py_require()install the required packages into an ephemeral virtual environment automatically.Point the
RETICULATE_PYTHONenvironment variable to a Python installation that has the required packages installed.
We recommend option 2 when running on many workers,
as it avoids the overhead of downloading and installing the packages on each worker.
Use install_python_learners() to create a conda environment with the required packages and set
RETICULATE_PYTHON to the returned Python binary.
The TabPFN learner additionally requires the TABPFN_TOKEN environment variable to download the model weights.
Super classes
mlr3::Learner -> LearnerAuto -> LearnerRegrAuto
Methods
LearnerRegrAuto$new()
Creates a new instance of this R6 class.
Usage
LearnerRegrAuto$new(id = "regr.auto", learner_ids, rush = NULL)Arguments
id(
character(1))
Identifier for the new instance.learner_ids(
character())
Learner that should be used.rushrush::Rush
Rush instance.
Examples
learner = lrn("regr.auto")
learner
#>
#> ── <LearnerRegrAuto> (regr.auto) ───────────────────────────────────────────────
#> • Model: -
#> • Parameters: check_learners=TRUE, devices=cpu, encapsulate_learner=TRUE,
#> encapsulate_mbo=TRUE, initial_design_default=FALSE,
#> initial_design_fraction=0.25, initial_design_set=0, initial_design_size=256,
#> initial_design_type=sobol, large_data_size=1000000, learner_timeout=900,
#> memory_limit=32000, n_threads=1, resampling=<ResamplingHoldout>,
#> small_data_resampling=<ResamplingCV>, small_data_size=5000,
#> store_benchmark_result=FALSE, store_models=FALSE,
#> terminator=<TerminatorRunTime>
#> • Packages: mlr3, mlr3tuning, mlr3pipelines, mlr3learners, mlr3extralearners,
#> catboost, ranger, callr, mlr3torch, glmnet, kknn, MASS, lightgbm, e1071, and
#> xgboost
#> • Predict Types: [response]
#> • Feature Types: logical, integer, numeric, character, factor, and ordered
#> • Encapsulation: none (fallback: -)
#> • Properties: missings and weights
#> • Other settings: use_weights = 'use', predict_raw = 'FALSE'
