| Title: | Extra Learners For mlr3 |
|---|---|
| Description: | Extra learners for use in mlr3. |
| Authors: | Raphael Sonabend [aut] (ORCID: <https://orcid.org/0000-0001-9225-4654>), Patrick Schratz [aut] (ORCID: <https://orcid.org/0000-0003-0748-6624>), Lorenz A. Kapsner [ctb] (ORCID: <https://orcid.org/0000-0003-1866-860X>), Lennart Schneider [ctb] (ORCID: <https://orcid.org/0000-0003-4152-5308>), Stephen A Lauer [ctb] (ORCID: <https://orcid.org/0000-0003-2948-630X>), Pierre Camilleri [ctb], Javier García [ctb], Keenan Ganz [ctb], Byron Jaeger [ctb], Sebastian Fischer [cre, aut], Zezhi Wang [ctb], John Zobolas [aut] (ORCID: <https://orcid.org/0000-0002-3609-8674>), Lukas Burk [ctb] (ORCID: <https://orcid.org/0000-0001-7528-3795>), Lona Koers [ctb], Anna Nazarova [ctb], Baisu Zhou [ctb], Marc Becker [ctb] (ORCID: <https://orcid.org/0000-0002-8115-0400>), Nikolai German [ctb], Alexander Winterstetter [ctb], Imad El Badisy [ctb] |
| Maintainer: | Sebastian Fischer <[email protected]> |
| License: | LGPL-3 |
| Version: | 1.5.2 |
| Built: | 2026-05-22 19:00:35 UTC |
| Source: | https://github.com/mlr-org/mlr3extralearners |
Extra learners for use in mlr3.
Maintainer: Sebastian Fischer [email protected]
Authors:
Raphael Sonabend [email protected] (ORCID)
Patrick Schratz [email protected] (ORCID)
John Zobolas [email protected] (ORCID)
Other contributors:
Lorenz A. Kapsner [email protected] (ORCID) [contributor]
Lennart Schneider [email protected] (ORCID) [contributor]
Stephen A Lauer [email protected] (ORCID) [contributor]
Pierre Camilleri [email protected] [contributor]
Javier García [email protected] [contributor]
Keenan Ganz [email protected] [contributor]
Byron Jaeger [email protected] [contributor]
Zezhi Wang [email protected] [contributor]
Lukas Burk [email protected] (ORCID) [contributor]
Lona Koers [email protected] [contributor]
Anna Nazarova [email protected] [contributor]
Baisu Zhou [email protected] [contributor]
Marc Becker [email protected] (ORCID) [contributor]
Nikolai German [email protected] [contributor]
Alexander Winterstetter [email protected] [contributor]
Imad El Badisy [email protected] [contributor]
Useful links:
Report bugs at https://github.com/mlr-org/mlr3extralearners/issues
Assert that the given Python packages are available.
assert_python_packages(packages, python_version = NULL)assert_python_packages(packages, python_version = NULL)
packages |
( |
python_version |
( |
(character())
Install required dependencies for specified learners. Works for packages on GitHub and CRAN, otherwise must be manually installed.
install_learners(.keys, repos = "https://cloud.r-project.org", ...)install_learners(.keys, repos = "https://cloud.r-project.org", ...)
.keys |
( |
repos |
( |
... |
( |
Lists all learners, properties, and associated packages in a table that can be filtered and queried.
list_mlr3learners(select = NULL, filter = NULL)list_mlr3learners(select = NULL, filter = NULL)
select |
|
filter |
|
Adaptive best-subset selection for classification.
Calls abess::abess() from abess.
This Learner can be instantiated via lrn():
lrn("classif.abess")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
| Id | Type | Default | Levels | Range |
| family | character | - | binomial, multinomial, ordinal | - |
| tune.path | character | sequence | sequence, gsection | - |
| tune.type | character | gic | gic, aic, bic, ebic, cv | - |
| normalize | integer | NULL | |
|
| support.size | untyped | NULL | - | |
| c.max | integer | 2 | |
|
| gs.range | untyped | NULL | - | |
| lambda | numeric | 0 | |
|
| always.include | untyped | NULL | - | |
| group.index | untyped | NULL | - | |
| init.active.set | untyped | NULL | - | |
| splicing.type | integer | 2 | |
|
| max.splicing.iter | integer | 20 | |
|
| screening.num | integer | NULL | |
|
| important.search | integer | NULL | |
|
| warm.start | logical | TRUE | TRUE, FALSE | - |
| nfolds | integer | 5 | |
|
| foldid | untyped | NULL | - | |
| cov.update | logical | FALSE | TRUE, FALSE | - |
| newton | character | exact | exact, approx | - |
| newton.thresh | numeric | 1e-06 | |
|
| max.newton.iter | integer | NULL | |
|
| early.stop | logical | FALSE | TRUE, FALSE | - |
| ic.scale | numeric | 1 | |
|
| num.threads | integer | 0 | |
|
| seed | integer | 0 |
|
num.threads: This parameter is initialized to 1 (default is 0) to avoid conflicts with the mlr3 parallelization.
family: Depends on the task type, if the parameter family is NULL, it is set to "binomial" for binary
classification tasks and to "multinomial" for multiclass classification problems.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifAbess
new()
Creates a new instance of this R6 class.
LearnerClassifAbess$new()
selected_features()
Extract the name of selected features from the model by abess::extract().
LearnerClassifAbess$selected_features()
The names of selected features
clone()
The objects of this class are cloneable with this method.
LearnerClassifAbess$clone(deep = FALSE)
deepWhether to make a deep clone.
bbayukari
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.abess") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.abess") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Classification using ada.
Calls ada::ada() from ada.
xval is set to 0 by default for speed.
This Learner can be instantiated via lrn():
lrn("classif.ada")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, ada, rpart
| Id | Type | Default | Levels | Range |
| bag.frac | numeric | 0.5 | |
|
| bag.shift | logical | FALSE | TRUE, FALSE | - |
| cp | numeric | 0.01 | |
|
| delta | numeric | 1e-10 | |
|
| iter | integer | 50 | |
|
| loss | character | exponential | exponential, logistic | - |
| max.iter | integer | 20 | |
|
| maxcompete | integer | 4 | |
|
| maxdepth | integer | 30 | |
|
| maxsurrogate | integer | 5 | |
|
| minbucket | integer | - | |
|
| minsplit | integer | 20 | |
|
| model.coef | logical | TRUE | TRUE, FALSE | - |
| n.iter | integer | 50 | |
|
| nu | numeric | 0.1 | |
|
| surrogatestyle | integer | 0 | |
|
| type | character | discrete | discrete, real, gentle | - |
| usesurrogate | integer | 2 | |
|
| verbose | logical | FALSE | TRUE, FALSE | - |
| xval | integer | 0 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifAdaBoosting
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifAdaBoosting$new()
oob_error()
The oob error is extracted extracted from the model slot $model$errs.
LearnerClassifAdaBoosting$oob_error()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerClassifAdaBoosting$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.ada") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.ada") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Classification boosting algorithm.
Calls adabag::boosting() from adabag.
xval:
Actual default: 10L
Initial value: 0L
Reason for change: Set to 0 for speed.
This Learner can be instantiated via lrn():
lrn("classif.adabag")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”
| Id | Type | Default | Levels | Range |
| boos | logical | TRUE | TRUE, FALSE | - |
| coeflearn | character | Breiman | Breiman, Freund, Zhu | - |
| cp | numeric | 0.01 | |
|
| maxcompete | integer | 4 | |
|
| maxdepth | integer | 30 | |
|
| maxsurrogate | integer | 5 | |
|
| mfinal | integer | 100 | |
|
| minbucket | integer | - | |
|
| minsplit | integer | 20 | |
|
| newmfinal | integer | - | |
|
| surrogatestyle | integer | 0 | |
|
| usesurrogate | integer | 2 | |
|
| xval | integer | 0 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifAdabag
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifAdabag$new()
importance()
The importance scores are extracted from the model.
LearnerClassifAdabag$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerClassifAdabag$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Alfaro, Esteban, Gamez, Matias, García, Noelia (2013). “adabag: An R Package for Classification with Boosting and Bagging.” Journal of Statistical Software, 54(2), 1-35. doi:10.18637/jss.v054.i02, https://www.jstatsoft.org/index.php/jss/article/view/v054i02.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.adabag", mfinal = 10L) print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.adabag", mfinal = 10L) print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Adaptive boosting algorithm for classification.
Calls RWeka::AdaBoostM1() from RWeka.
This Learner can be instantiated via lrn():
lrn("classif.AdaBoostM1")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, RWeka
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| P | integer | 100 | |
|
| Q | logical | FALSE | TRUE, FALSE | - |
| S | integer | 1 | |
|
| I | integer | 10 | |
|
| W | untyped | "DecisionStump" | - | |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifAdaBoostM1
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifAdaBoostM1$new()
marshal()
Marshal the learner's model.
LearnerClassifAdaBoostM1$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifAdaBoostM1$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifAdaBoostM1$clone(deep = FALSE)
deepWhether to make a deep clone.
henrifnk
Freund, Yoav, Schapire, E R, others (1996). “Experiments with a new boosting algorithm.” In icml, volume 96, 148–156. Citeseer.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.AdaBoostM1") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.AdaBoostM1") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Accelerated oblique random classification forest.
Calls aorsf::orsf() from aorsf.
Note that although the learner has the property "missing" and it can in
principle deal with missing values, the behaviour has to be configured using
the parameter na_action.
n_thread: This parameter is initialized to 1 (default is 0) to avoid conflicts with the mlr3 parallelization.
pred_simplify has to be TRUE, otherwise response is NA in prediction
This Learner can be instantiated via lrn():
lrn("classif.aorsf")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, aorsf
| Id | Type | Default | Levels | Range |
| attach_data | logical | TRUE | TRUE, FALSE | - |
| epsilon | numeric | 1e-09 | |
|
| importance | character | anova | none, anova, negate, permute | - |
| importance_max_pvalue | numeric | 0.01 | |
|
| leaf_min_events | integer | 1 | |
|
| leaf_min_obs | integer | 5 | |
|
| max_iter | integer | 20 | |
|
| method | character | glm | glm, net, pca, random | - |
| mtry | integer | NULL | |
|
| mtry_ratio | numeric | - | |
|
| n_retry | integer | 3 | |
|
| n_split | integer | 5 | |
|
| n_thread | integer | - | |
|
| n_tree | integer | 500 | |
|
| na_action | character | fail | fail, impute_meanmode | - |
| net_mix | numeric | 0.5 | |
|
| oobag | logical | FALSE | TRUE, FALSE | - |
| oobag_eval_every | integer | NULL | |
|
| oobag_fun | untyped | NULL | - | |
| oobag_pred_type | character | prob | none, leaf, prob, class | - |
| pred_aggregate | logical | TRUE | TRUE, FALSE | - |
| sample_fraction | numeric | 0.632 | |
|
| sample_with_replacement | logical | TRUE | TRUE, FALSE | - |
| scale_x | logical | FALSE | TRUE, FALSE | - |
| split_min_events | integer | 5 | |
|
| split_min_obs | integer | 10 | |
|
| split_min_stat | numeric | NULL | |
|
| split_rule | character | gini | gini, cstat | - |
| target_df | integer | NULL | |
|
| tree_seeds | integer | NULL | |
|
| verbose_progress | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifObliqueRandomForest
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifObliqueRandomForest$new()
oob_error()
OOB concordance error extracted from the model slot
eval_oobag$stat_values
LearnerClassifObliqueRandomForest$oob_error()
numeric().
importance()
The importance scores are extracted from the model.
LearnerClassifObliqueRandomForest$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerClassifObliqueRandomForest$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.aorsf") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.aorsf") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bayesian Additive Regression Trees are similar to gradient boosting algorithms.
The classification problem is solved by 0-1 encoding of the two-class targets and setting the
decision threshold to p = 0.5 during the prediction phase.
Calls dbarts::bart() from dbarts.
This Learner can be instantiated via lrn():
lrn("classif.bart")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, dbarts
| Id | Type | Default | Levels | Range |
| ntree | integer | 200 | |
|
| k | numeric | 2 | |
|
| power | numeric | 2 | |
|
| base | numeric | 0.95 | |
|
| binaryOffset | numeric | 0 | |
|
| ndpost | integer | 1000 | |
|
| nskip | integer | 100 | |
|
| printevery | integer | 100 | |
|
| keepevery | integer | 1 | |
|
| keeptrainfits | logical | TRUE | TRUE, FALSE | - |
| usequants | logical | FALSE | TRUE, FALSE | - |
| numcut | integer | 100 | |
|
| printcutoffs | integer | 0 | |
|
| verbose | logical | FALSE | TRUE, FALSE | - |
| nthread | integer | 1 | |
|
| keepcall | logical | TRUE | TRUE, FALSE | - |
| sampleronly | logical | FALSE | TRUE, FALSE | - |
| seed | integer | NA | |
|
| proposalprobs | untyped | NULL | - | |
| splitprobs | untyped | NULL | - | |
| keepsampler | logical | - | TRUE, FALSE | - |
| n.threads | integer | - |
|
Parameter: keeptrees
Original: FALSE
New: TRUE
Reason: Required for prediction
Parameter: offset
The parameter is removed, because only dbarts::bart2 allows an offset during training,
and therefore the offset parameter in dbarts:::predict.bart is irrelevant for
dbarts::dbart.
Parameter: nchain, combineChains, combinechains
The parameters are removed as parallelization of multiple models is handled by future.
Parameter: sigest, sigdf, sigquant, keeptres
Regression only.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifBart
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifBart$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifBart$clone(deep = FALSE)
deepWhether to make a deep clone.
ck37
Sparapani, Rodney, Spanbauer, Charles, McCulloch, Robert (2021). “Nonparametric machine learning and efficient computation with bayesian additive regression trees: the BART R package.” Journal of Statistical Software, 97, 1–66.
Chipman, A H, George, I E, McCulloch, E R (2010). “BART: Bayesian additive regression trees.” The Annals of Applied Statistics, 4(1), 266–298.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.bart") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.bart") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bayes Network learning using various search algorithms.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
N removed:
Initial structure is empty
P removed:
Maximum number of parents
R removed:
Random order
mbc removed:
Applies a Markov Blanket correction to the network structure, after a network structure is learned
S removed:
Score type
A removed:
Initial count (alpha)
Reason for change: The parameters are removed because they don't work out of the box and it's unclear how to use them.
This Learner can be instantiated via lrn():
lrn("classif.bayes_net")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| D | logical | - | TRUE, FALSE | - |
| B | untyped | - | - | |
| Q | character | - | global.K2, global.HillClimber, global.SimulatedAnnealing, global.TabuSearch, global.TAN, local.K2, local.HillClimber, local.LAGDHillClimber, local.SimulatedAnnealing, local.TabuSearch, [...] | - |
| E | character | - | estimate.SimpleEstimator, estimate.BMAEstimator, estimate.MultiNomialBMAEstimator | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifBayesNet
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifBayesNet$new()
marshal()
Marshal the learner's model.
LearnerClassifBayesNet$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifBayesNet$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifBayesNet$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.bayes_net") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.bayes_net") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Random forests for blocks of clinical and omics covariate data.
Calls blockForest::blockfor() from package blockForest.
In this learner, only the trained forest object ($forest) is retained. The
optimized block-specific tuning parameters (paramvalues) and the biased OOB
error estimate (biased_oob_error_donotuse) are discarded, as they are either
not needed for downstream use or not reliable for performance estimation.
num.threads is initialized to 1 to avoid conflicts with parallelization via future.
This Learner can be instantiated via lrn():
lrn("classif.blockforest")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, blockForest
| Id | Type | Default | Levels | Range |
| blocks | untyped | - | - | |
| block.method | character | BlockForest | BlockForest, RandomBlock, BlockVarSel, VarProb, SplitWeights | - |
| num.trees | integer | 2000 | |
|
| mtry | untyped | NULL | - | |
| nsets | integer | 300 | |
|
| num.trees.pre | integer | 1500 | |
|
| splitrule | character | extratrees | extratrees, gini | - |
| always.select.block | integer | 0 | |
|
| importance | character | - | none, impurity, impurity_corrected, permutation | - |
| num.threads | integer | - | |
|
| seed | integer | NULL | |
|
| verbose | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifBlockForest
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifBlockForest$new()
importance()
The importance scores are extracted from the model slot variable.importance.
LearnerClassifBlockForest$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerClassifBlockForest$clone(deep = FALSE)
deepWhether to make a deep clone.
bblodfon
Hornung, R., Wright, N. M (2019). “Block Forests: Random forests for blocks of clinical and omics covariate data.” BMC Bioinformatics, 20(1), 1–17. doi:10.1186/s12859-019-2942-y, https://doi.org/10.1186/s12859-019-2942-y.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # check task's features task$feature_names # partition features to 2 blocks blocks = list(bl1 = 1:42, bl2 = 43:60) # define learner learner = lrn("classif.blockforest", blocks = blocks, importance = "permutation", nsets = 10, predict_type = "prob", num.trees = 50, num.trees.pre = 10, splitrule = "gini") # Train the learner on the training ids learner$train(task, row_ids = ids$train) # feature importance learner$importance() # Make predictions for the test observations pred = learner$predict(task, row_ids = ids$test) pred # Score the predictions pred$score()# Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # check task's features task$feature_names # partition features to 2 blocks blocks = list(bl1 = 1:42, bl2 = 43:60) # define learner learner = lrn("classif.blockforest", blocks = blocks, importance = "permutation", nsets = 10, predict_type = "prob", num.trees = 50, num.trees.pre = 10, splitrule = "gini") # Train the learner on the training ids learner$train(task, row_ids = ids$train) # feature importance learner$importance() # Make predictions for the test observations pred = learner$predict(task, row_ids = ids$test) pred # Score the predictions pred$score()
Classification gradient boosting learner.
Calls bst::bst() from bst.
Learner = "ls": Default base learner type
xval = 0: No cross-validation
maxdepth = 1: Maximum tree depth
This Learner can be instantiated via lrn():
lrn("classif.bst")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “numeric”
Required Packages: mlr3, mlr3extralearners, bst, rpart
| Id | Type | Default | Levels | Range |
| center | logical | FALSE | TRUE, FALSE | - |
| coefir | untyped | NULL | - | |
| cost | numeric | 0.5 | |
|
| cp | numeric | 0.01 | |
|
| df | integer | 4 | |
|
| family | character | hinge | hinge, hinge2, binom, thingeDC, tbinomDC, binomdDC, loss, clossR, clossRMM, clossMM | - |
| f.init | untyped | NULL | - | |
| fk | untyped | NULL | - | |
| intercept | logical | TRUE | TRUE, FALSE | - |
| iter | integer | 1 | |
|
| Learner | character | ls | ls, sm, tree | - |
| maxdepth | integer | 1 | |
|
| maxsurrogate | integer | 5 | |
|
| minbucket | integer | - | |
|
| minsplit | integer | 20 | |
|
| mstop | integer | 50 | |
|
| numsample | integer | 50 | |
|
| nu | numeric | 0.1 | |
|
| q | numeric | - | |
|
| qh | numeric | - | |
|
| s | numeric | - | |
|
| sh | numeric | - | |
|
| start | logical | FALSE | TRUE, FALSE | - |
| surrogatestyle | integer | 0 | |
|
| threshold | character | adaptive | adaptive, fixed | - |
| trace | logical | FALSE | TRUE, FALSE | - |
| trun | logical | FALSE | TRUE, FALSE | - |
| twinboost | logical | FALSE | TRUE, FALSE | - |
| twintype | integer | 1 | |
|
| xselect.init | untyped | NULL | - | |
| xval | integer | 10 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifBst
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifBst$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifBst$clone(deep = FALSE)
deepWhether to make a deep clone.
Only classification-appropriate loss functions are available for the family parameter.
annanzrv
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.bst") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.bst") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Decision Tree Algorithm.
Calls C50::C5.0.formula() from C50.
This Learner can be instantiated via lrn():
lrn("classif.C50")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, C50
| Id | Type | Default | Levels | Range |
| trials | integer | 1 | |
|
| rules | logical | FALSE | TRUE, FALSE | - |
| costs | untyped | NULL | - | |
| subset | logical | TRUE | TRUE, FALSE | - |
| bands | integer | - | |
|
| winnow | logical | FALSE | TRUE, FALSE | - |
| noGlobalPruning | logical | FALSE | TRUE, FALSE | - |
| CF | numeric | 0.25 | |
|
| minCases | integer | 2 | |
|
| fuzzyThreshold | logical | FALSE | TRUE, FALSE | - |
| sample | numeric | 0 | |
|
| seed | integer | - | |
|
| earlyStopping | logical | TRUE | TRUE, FALSE | - |
| label | untyped | "outcome" | - | |
| na.action | untyped | "stats::na.pass" | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifC50
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifC50$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifC50$clone(deep = FALSE)
deepWhether to make a deep clone.
henrifnk
Quinlan, Ross J (2014). C4. 5: programs for machine learning. Elsevier.
Gradient boosting algorithm that also supports categorical data.
Calls catboost::catboost.train() from package 'catboost'.
This Learner can be instantiated via lrn():
lrn("classif.catboost")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, catboost
| Id | Type | Default | Levels | Range |
| loss_function_twoclass | character | Logloss | Logloss, CrossEntropy | - |
| loss_function_multiclass | character | MultiClass | MultiClass, MultiClassOneVsAll | - |
| learning_rate | numeric | 0.03 | |
|
| random_seed | integer | 0 | |
|
| l2_leaf_reg | numeric | 3 | |
|
| bootstrap_type | character | - | Bayesian, Bernoulli, MVS, Poisson, No | - |
| bagging_temperature | numeric | 1 | |
|
| subsample | numeric | - | |
|
| sampling_frequency | character | PerTreeLevel | PerTree, PerTreeLevel | - |
| sampling_unit | character | Object | Object, Group | - |
| mvs_reg | numeric | - | |
|
| random_strength | numeric | 1 | |
|
| depth | integer | 6 | |
|
| grow_policy | character | SymmetricTree | SymmetricTree, Depthwise, Lossguide | - |
| min_data_in_leaf | integer | 1 | |
|
| max_leaves | integer | 31 | |
|
| ignored_features | untyped | NULL | - | |
| one_hot_max_size | untyped | FALSE | - | |
| has_time | logical | FALSE | TRUE, FALSE | - |
| rsm | numeric | 1 | |
|
| nan_mode | character | Min | Min, Max | - |
| fold_permutation_block | integer | - | |
|
| leaf_estimation_method | character | - | Newton, Gradient, Exact | - |
| leaf_estimation_iterations | integer | - | |
|
| leaf_estimation_backtracking | character | AnyImprovement | No, AnyImprovement, Armijo | - |
| fold_len_multiplier | numeric | 2 | |
|
| approx_on_full_history | logical | TRUE | TRUE, FALSE | - |
| class_weights | untyped | - | - | |
| auto_class_weights | character | None | None, Balanced, SqrtBalanced | - |
| boosting_type | character | - | Ordered, Plain | - |
| boost_from_average | logical | - | TRUE, FALSE | - |
| langevin | logical | FALSE | TRUE, FALSE | - |
| diffusion_temperature | numeric | 10000 | |
|
| score_function | character | Cosine | Cosine, L2, NewtonCosine, NewtonL2 | - |
| monotone_constraints | untyped | - | - | |
| feature_weights | untyped | - | - | |
| first_feature_use_penalties | untyped | - | - | |
| penalties_coefficient | numeric | 1 | |
|
| per_object_feature_penalties | untyped | - | - | |
| model_shrink_rate | numeric | - | |
|
| model_shrink_mode | character | - | Constant, Decreasing | - |
| target_border | numeric | - | |
|
| border_count | integer | - | |
|
| feature_border_type | character | GreedyLogSum | Median, Uniform, UniformAndQuantiles, MaxLogSum, MinEntropy, GreedyLogSum | - |
| per_float_feature_quantization | untyped | - | - | |
| classes_count | integer | - | |
|
| thread_count | integer | 1 | |
|
| task_type | character | CPU | CPU, GPU | - |
| devices | untyped | - | - | |
| logging_level | character | Silent | Silent, Verbose, Info, Debug | - |
| metric_period | integer | 1 | |
|
| train_dir | untyped | "catboost_info" | - | |
| model_size_reg | numeric | 0.5 | |
|
| allow_writing_files | logical | FALSE | TRUE, FALSE | - |
| save_snapshot | logical | FALSE | TRUE, FALSE | - |
| snapshot_file | untyped | - | - | |
| snapshot_interval | integer | 600 | |
|
| simple_ctr | untyped | - | - | |
| combinations_ctr | untyped | - | - | |
| ctr_target_border_count | integer | - | |
|
| counter_calc_method | character | Full | SkipTest, Full | - |
| max_ctr_complexity | integer | - | |
|
| ctr_leaf_count_limit | integer | - | |
|
| store_all_simple_ctr | logical | FALSE | TRUE, FALSE | - |
| final_ctr_computation_mode | character | Default | Default, Skip | - |
| verbose | logical | FALSE | TRUE, FALSE | - |
| ntree_start | integer | 0 | |
|
| ntree_end | integer | 0 | |
|
| early_stopping_rounds | integer | - | |
|
| eval_metric | untyped | - | - | |
| use_best_model | logical | - | TRUE, FALSE | - |
| iterations | integer | 1000 |
|
See https://catboost.ai/en/docs/concepts/r-installation.
logging_level:
Actual default: "Verbose"
Adjusted default: "Silent"
Reason for change: consistent with other mlr3 learners
thread_count:
Actual default: -1
Adjusted default: 1
Reason for change: consistent with other mlr3 learners
allow_writing_files:
Actual default: TRUE
Adjusted default: FALSE
Reason for change: consistent with other mlr3 learners
save_snapshot:
Actual default: TRUE
Adjusted default: FALSE
Reason for change: consistent with other mlr3 learners
Early stopping can be used to find the optimal number of boosting rounds.
Set early_stopping_rounds to an integer value to monitor the performance of the model on the validation set while training.
For information on how to configure the validation set, see the Validation section of mlr3::Learner.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifCatboost
internal_valid_scoresThe last observation of the validation scores for all metrics.
Extracted from model$evaluation_log
internal_tuned_valuesReturns the early stopped iterations if early_stopping_rounds was set during training.
validateHow to construct the internal validation data. This parameter can be either NULL, a ratio, "test", or "predefined".
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Create a LearnerClassifCatboost object.
LearnerClassifCatboost$new()
importance()
The importance scores are calculated using
catboost::catboost.get_feature_importance(),
setting type = "FeatureImportance", returned for 'all'.
LearnerClassifCatboost$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerClassifCatboost$clone(deep = FALSE)
deepWhether to make a deep clone.
sumny
Dorogush, Veronika A, Ershov, Vasily, Gulin, Andrey (2018). “CatBoost: gradient boosting with categorical features support.” arXiv preprint arXiv:1810.11363.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.catboost", iterations = 10) print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.catboost", iterations = 10) print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
A random forest based on conditional inference trees (partykit::ctree()).
Calls partykit::cforest() from partykit.
This Learner can be instantiated via lrn():
lrn("classif.cforest")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, partykit, sandwich, coin
| Id | Type | Default | Levels | Range |
| ntree | integer | 500 | |
|
| replace | logical | FALSE | TRUE, FALSE | - |
| fraction | numeric | 0.632 | |
|
| mtry | integer | - | |
|
| mtryratio | numeric | - | |
|
| applyfun | untyped | - | - | |
| cores | integer | NULL | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| cluster | untyped | - | - | |
| scores | untyped | - | - | |
| teststat | character | quadratic | quadratic, maximum | - |
| splitstat | character | quadratic | quadratic, maximum | - |
| splittest | logical | FALSE | TRUE, FALSE | - |
| testtype | character | Univariate | Bonferroni, MonteCarlo, Univariate, Teststatistic | - |
| nmax | untyped | - | - | |
| pargs | untyped | - | - | |
| alpha | numeric | 0.05 | |
|
| mincriterion | numeric | 0 | |
|
| logmincriterion | numeric | 0 | |
|
| minsplit | integer | 20 | |
|
| minbucket | integer | 7 | |
|
| minprob | numeric | 0.01 | |
|
| stump | logical | FALSE | TRUE, FALSE | - |
| lookahead | logical | FALSE | TRUE, FALSE | - |
| MIA | logical | FALSE | TRUE, FALSE | - |
| nresample | integer | 9999 | |
|
| tol | numeric | 1.490116e-08 | |
|
| maxsurrogate | integer | 0 | |
|
| numsurrogate | logical | FALSE | TRUE, FALSE | - |
| maxdepth | integer | Inf | |
|
| multiway | logical | FALSE | TRUE, FALSE | - |
| splittry | integer | 2 | |
|
| intersplit | logical | FALSE | TRUE, FALSE | - |
| majority | logical | FALSE | TRUE, FALSE | - |
| caseweights | logical | TRUE | TRUE, FALSE | - |
| saveinfo | logical | FALSE | TRUE, FALSE | - |
| update | logical | FALSE | TRUE, FALSE | - |
| splitflavour | character | ctree | ctree, exhaustive | - |
| maxvar | integer | - | |
|
| OOB | logical | FALSE | TRUE, FALSE | - |
| simplify | logical | TRUE | TRUE, FALSE | - |
| scale | logical | TRUE | TRUE, FALSE | - |
| nperm | integer | 1 | |
|
| risk | character | loglik | loglik, misclassification | - |
| conditional | logical | FALSE | TRUE, FALSE | - |
| threshold | numeric | 0.2 |
|
mtry:
This hyperparameter can alternatively be set via the added hyperparameter mtryratio
as mtry = max(ceiling(mtryratio * n_features), 1).
Note that mtry and mtryratio are mutually exclusive.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifCForest
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifCForest$new()
oob_error()
The importance scores are calculated using partykit::varimp().
The out-of-bag error, calculated using the OOB predictions from
partykit.
LearnerClassifCForest$oob_error()
numeric(1).
clone()
The objects of this class are cloneable with this method.
LearnerClassifCForest$clone(deep = FALSE)
deepWhether to make a deep clone.
sumny
Hothorn T, Zeileis A (2015). “partykit: A Modular Toolkit for Recursive Partytioning in R.” Journal of Machine Learning Research, 16(118), 3905-3909. http://jmlr.org/papers/v16/hothorn15a.html.
Hothorn T, Hornik K, Zeileis A (2006). “Unbiased Recursive Partitioning: A Conditional Inference Framework.” Journal of Computational and Graphical Statistics, 15(3), 651–674. doi:10.1198/106186006x133933, https://doi.org/10.1198/106186006x133933.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.cforest", ntree = 50L) print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.cforest", ntree = 50L) print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Classification Partition Tree where a significance test is used to determine the univariate
splits. Calls partykit::ctree() from partykit.
This Learner can be instantiated via lrn():
lrn("classif.ctree")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, partykit, sandwich, coin
| Id | Type | Default | Levels | Range |
| teststat | character | quadratic | quadratic, maximum | - |
| splitstat | character | quadratic | quadratic, maximum | - |
| splittest | logical | FALSE | TRUE, FALSE | - |
| testtype | character | Bonferroni | Bonferroni, MonteCarlo, Univariate, Teststatistic | - |
| nmax | untyped | - | - | |
| alpha | numeric | 0.05 | |
|
| mincriterion | numeric | 0.95 | |
|
| logmincriterion | numeric | - | |
|
| minsplit | integer | 20 | |
|
| minbucket | integer | 7 | |
|
| minprob | numeric | 0.01 | |
|
| stump | logical | FALSE | TRUE, FALSE | - |
| lookahead | logical | FALSE | TRUE, FALSE | - |
| MIA | logical | FALSE | TRUE, FALSE | - |
| nresample | integer | 9999 | |
|
| tol | numeric | - | |
|
| maxsurrogate | integer | 0 | |
|
| numsurrogate | logical | FALSE | TRUE, FALSE | - |
| mtry | integer | Inf | |
|
| maxdepth | integer | Inf | |
|
| multiway | logical | FALSE | TRUE, FALSE | - |
| splittry | integer | 2 | |
|
| intersplit | logical | FALSE | TRUE, FALSE | - |
| majority | logical | FALSE | TRUE, FALSE | - |
| caseweights | logical | FALSE | TRUE, FALSE | - |
| maxvar | integer | - | |
|
| applyfun | untyped | - | - | |
| cores | integer | NULL | |
|
| saveinfo | logical | TRUE | TRUE, FALSE | - |
| update | logical | FALSE | TRUE, FALSE | - |
| splitflavour | character | ctree | ctree, exhaustive | - |
| cluster | untyped | - | - | |
| scores | untyped | - | - | |
| doFit | logical | TRUE | TRUE, FALSE | - |
| maxpts | integer | 25000 | |
|
| abseps | numeric | 0.001 | |
|
| releps | numeric | 0 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifCTree
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifCTree$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifCTree$clone(deep = FALSE)
deepWhether to make a deep clone.
sumny
Hothorn T, Zeileis A (2015). “partykit: A Modular Toolkit for Recursive Partytioning in R.” Journal of Machine Learning Research, 16(118), 3905-3909. http://jmlr.org/papers/v16/hothorn15a.html.
Hothorn T, Hornik K, Zeileis A (2006). “Unbiased Recursive Partitioning: A Conditional Inference Framework.” Journal of Computational and Graphical Statistics, 15(3), 651–674. doi:10.1198/106186006x133933, https://doi.org/10.1198/106186006x133933.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.ctree") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.ctree") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
MCP- or SCAD-penalized binary classification model with k-fold cross validation
for choosing the regularization parameter lambda.
Calls ncvreg::cv.ncvreg() from package ncvreg with family set to
"binomial".
Covariates are internally standardized by ncvreg prior to model fitting.
This Learner can be instantiated via lrn():
lrn("classif.cv_ncvreg")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, ncvreg
| Id | Type | Default | Levels | Range |
| penalty | character | MCP | MCP, SCAD, lasso | - |
| gamma | numeric | - | |
|
| alpha | numeric | 1 | |
|
| lambda.min | numeric | - | |
|
| nlambda | integer | 100 | |
|
| lambda | untyped | - | - | |
| eps | numeric | 1e-04 | |
|
| max.iter | integer | 10000 | |
|
| convex | logical | TRUE | TRUE, FALSE | - |
| dfmax | integer | - | |
|
| penalty.factor | untyped | - | - | |
| warn | logical | TRUE | TRUE, FALSE | - |
| returnX | logical | TRUE | TRUE, FALSE | - |
| cluster | untyped | - | - | |
| nfolds | integer | 10 | |
|
| fold | untyped | - | - | |
| returnY | logical | FALSE | TRUE, FALSE | - |
| trace | logical | FALSE | TRUE, FALSE | - |
| pred_lambda | numeric | - |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifNCVreg
new()
Creates a new instance of this R6 class.
LearnerClassifNCVreg$new()
selected_features()
Returns the set of selected features which have non-zero coefficients.
Calls the internal coef.cv.ncvreg() function.
LearnerClassifNCVreg$selected_features(lambda = NULL)
lambda(numeric(1))
Custom lambda, defaults to the lambda with the minimum CV error.
(character()) vector of feature names.
clone()
The objects of this class are cloneable with this method.
LearnerClassifNCVreg$clone(deep = FALSE)
deepWhether to make a deep clone.
bblodfon
Breheny P, Huang J (2011). “Coordinate descent algorithms for nonconvex penalized regression, with applications to biological feature selection.” Annals of Applied Statistics, 5(1), 232–253. ISSN 1932-6157, doi:10.1214/10-AOAS388.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.cv_ncvreg") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.cv_ncvreg") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Deep neural network with weights initialized by a deep belief network.
Calls deepnet::dbn.dnn.train() from deepnet.
This learner works with tasks that have at least two features.
output is set to "softmax" to enable class probabilities.
This Learner can be instantiated via lrn():
lrn("classif.dbnDNN")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
| Id | Type | Default | Levels | Range |
| hidden | untyped | - | - | |
| activationfun | character | - | sigm, linear, tanh | - |
| learningrate | numeric | - | |
|
| momentum | numeric | - | |
|
| learningrate_scale | numeric | - | |
|
| numepochs | integer | - | |
|
| batchsize | integer | - | |
|
| output | character | - | sigm, linear, softmax | - |
| hidden_dropout | numeric | - | |
|
| visible_dropout | numeric | - | |
|
| cd | integer | - |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifDbnDNN
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifDbnDNN$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifDbnDNN$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Rong X (2014). deepnet: Deep Learning Toolkit in R. R package version 0.2.1, https://CRAN.R-project.org/package=deepnet.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.dbnDNN") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.dbnDNN") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Decision Stump Learner.
Calls RWeka::DecisionStump() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("classif.decision_stump")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifDecisionStump
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifDecisionStump$new()
marshal()
Marshal the learner's model.
LearnerClassifDecisionStump$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifDecisionStump$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifDecisionStump$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.decision_stump") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.decision_stump") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Simple Decision Table majority classifier.
Calls RWeka::make_Weka_classifier() from RWeka.
E:
Has only 2 out of 4 original evaluation measures : acc and auc with acc being the default
Reason for change: this learner should only contain evaluation measures appropriate for classification tasks
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
P_best:
original id: P
D_best:
original id: D
N_best:
original id: N
S_best:
original id: S
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("classif.decision_table")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| S | character | BestFirst | BestFirst, GreedyStepwise | - |
| X | integer | 1 | |
|
| E | character | acc | acc, auc | - |
| I | logical | - | TRUE, FALSE | - |
| R | logical | - | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| P_best | untyped | - | - | |
| D_best | character | 1 | 0, 1, 2 | - |
| N_best | integer | - | |
|
| S_best | integer | 1 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifDecisionTable
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifDecisionTable$new()
marshal()
Marshal the learner's model.
LearnerClassifDecisionTable$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifDecisionTable$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifDecisionTable$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Kohavi R (1995). “The Power of Decision Tables.” In 8th European Conference on Machine Learning, 174–189.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.decision_table") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.decision_table") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Diagonal Linear Discriminant Analysis classifier.
Belongs to the family of Naive Bayes classifiers, where the distributions of
each class are assumed to be multivariate normal and to share a common
covariance matrix. Off-diagonal elements of the pooled sample covariance matrix
are set to zero
Calls sparsediscrim::lda_diag() from sparsediscrim.
This Learner can be instantiated via lrn():
lrn("classif.dlda")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, sparsediscrim
| Id | Type | Default |
| prior | untyped | NULL |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifDiagLda
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifDiagLda$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifDiagLda$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Dudoit S, Fridlyand J, Speed TP (2002). “Comparison of Discrimination Methods for the Classification of Tumors Using Gene Expression Data.” Journal of the American Statistical Association, 97(457), 77–87. doi:10.1198/016214502753479248.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.dlda") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.dlda") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
This is an alternative implementation of MARS (Multivariate Adaptive Regression Splines). The classification problem is solved by 0-1 encoding of the two-class targets and setting the decision threshold to p = 0.5 during the prediction phase. MARS is trademarked and thus not used as the name. The name "earth" stands for "Enhanced Adaptive Regression Through Hinges".
Methods for variance estimations are not yet implemented.
This Learner can be instantiated via lrn():
lrn("classif.earth")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, earth
| Id | Type | Default | Levels | Range |
| wp | untyped | NULL | - | |
| offset | untyped | NULL | - | |
| keepxy | logical | FALSE | TRUE, FALSE | - |
| trace | character | 0 | 0, .3, .5, 1, 2, 3, 4, 5 | - |
| degree | integer | 1 | |
|
| penalty | numeric | 2 | |
|
| nk | untyped | NULL | - | |
| thresh | numeric | 0.001 | |
|
| minspan | numeric | 0 | |
|
| endspan | numeric | 0 | |
|
| newvar.penalty | numeric | 0 | |
|
| fast.k | integer | 20 | |
|
| fast.beta | integer | 1 | |
|
| linpreds | untyped | FALSE | - | |
| allowed | untyped | - | - | |
| pmethod | character | backward | backward, none, exhaustive, forward, seqrep, cv | - |
| nprune | integer | - | |
|
| nfold | integer | 0 | |
|
| ncross | integer | 1 | |
|
| stratify | logical | TRUE | TRUE, FALSE | - |
| varmod.method | character | none | none, const, lm, rlm, earth, gam, power, power0, x.lm, x.rlm, [...] | - |
| varmod.exponent | numeric | 1 | |
|
| varmod.conv | numeric | 1 | |
|
| varmod.clamp | numeric | 0.1 | |
|
| varmod.minspan | numeric | -3 | |
|
| Scale.y | logical | FALSE | TRUE, FALSE | - |
| Adjust.endspan | numeric | 2 | |
|
| Auto.linpreds | logical | TRUE | TRUE, FALSE | - |
| Force.weights | logical | FALSE | TRUE, FALSE | - |
| Use.beta.cache | logical | TRUE | TRUE, FALSE | - |
| Force.xtx.prune | logical | FALSE | TRUE, FALSE | - |
| Get.leverages | logical | TRUE | TRUE, FALSE | - |
| Exhaustive.tol | numeric | 1e-10 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifEarth
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifEarth$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifEarth$clone(deep = FALSE)
deepWhether to make a deep clone.
pkopper
Milborrow, Stephen, Hastie, T, Tibshirani, R (2014). “Earth: multivariate adaptive regression spline models.” R package version, 3(7).
Friedman, H J (1991). “Multivariate adaptive regression splines.” The annals of statistics, 19(1), 1–67.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.earth") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.earth") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Evolutionary learning of globally optimal classification trees.
Calls evtree::evtree() fromevtree.
pmutatemajor, pmutateminor, pcrossover, psplit, and pprune,
are scaled internally to sum to 100.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifEvtree
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifEvtree$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifEvtree$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.evtree") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.evtree") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Logistic Regression, where the features used in the model are selected by running Exhaustive Search.
Calls ExhaustiveSearch::ExhaustiveSearch() from ExhaustiveSearch.
family:
Actual default: NULL
Adjusted default: "binomial"
Reason for change: To comply with mlr3 architecture, we differentiate between classification and regression learners.
nThreads:
Actual default: NULL
Adjusted default: 1
Reason for change: Suppressing the automatic internal parallelization if
cv.folds > 0.
quietly:
Actual default: FALSE
Adjusted default: TRUE
Reason for change: Suppression of constant printing to console
This Learner can be instantiated via lrn():
lrn("classif.exhaustive_search")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, ExhaustiveSearch
| Id | Type | Default | Levels | Range |
| family | character | - | gaussian, binomial | - |
| performanceMeasure | character | - | MSE, AIC | - |
| combsUpTo | integer | - | |
|
| nResults | integer | 5000 | |
|
| nThreads | integer | - | |
|
| testSetIDs | integer | - | |
|
| errorVal | untyped | -1L | - | |
| quietly | logical | - | TRUE, FALSE | - |
| checkLarge | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifExhaustiveSearch
new()
Creates a new instance of this R6 class.
LearnerClassifExhaustiveSearch$new()
selected_features()
Extracts selected features of this learner.
LearnerClassifExhaustiveSearch$selected_features()
clone()
The objects of this class are cloneable with this method.
LearnerClassifExhaustiveSearch$clone(deep = FALSE)
deepWhether to make a deep clone.
ngerman
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# define the learner learner = lrn("classif.exhaustive_search", predict_type = "prob", combsUpTo = 3) # define the task # and subset to 3 features to speed up the example tsk_sonar = tsk("sonar")$select(c("V1", "V2", "V3")) # train the learner learner$train(tsk_sonar) # extract selected features learner$selected_features() # predict on training task learner$predict(tsk_sonar)# define the learner learner = lrn("classif.exhaustive_search", predict_type = "prob", combsUpTo = 3) # define the task # and subset to 3 features to speed up the example tsk_sonar = tsk("sonar")$select(c("V1", "V2", "V3")) # train the learner learner$train(tsk_sonar) # extract selected features learner$selected_features() # predict on training task learner$predict(tsk_sonar)
Simple and fast neural nets for tabular data classification.
Calls fastai::tabular_learner() from package fastai.
The Python dependencies are automatically installed via reticulate::py_require().
See Installing Python Dependencies for more details.
You can manually specify a virtual environment by calling reticulate::use_virtualenv() prior to calling the $train() function.
In this virtual environment, the fastai package and its dependencies must be installed.
In order to save a lrn("classif.fastai") for later usage, it is necessary to call the $marshal() method on the Learner before writing it to disk,
as the object will otherwise not be saved correctly.
After loading a marshaled lrn("classif.fastai") into R again, you then need to call $unmarshal() to transform it into a useable state.
n_epoch:
Needs to be set for fastai::fit() to work.
If no value is given, it is set to 5.
eval_metric:
Needs to be set for fastai::predict() to work.
If no value is given, it is set to fastai::accuracy().
This Learner can be instantiated via lrn():
lrn("classif.fastai")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, fastai, reticulate
| Id | Type | Default | Levels | Range |
| act_cls | untyped | - | - | |
| bn_cont | logical | TRUE | TRUE, FALSE | - |
| bn_final | logical | FALSE | TRUE, FALSE | - |
| drop_last | logical | FALSE | TRUE, FALSE | - |
| embed_p | numeric | 0 | |
|
| emb_szs | untyped | NULL | - | |
| n_epoch | integer | 5 | |
|
| eval_metric | untyped | - | - | |
| layers | untyped | - | - | |
| loss_func | untyped | - | - | |
| lr | numeric | 0.001 | |
|
| metrics | untyped | - | - | |
| n_out | integer | - | |
|
| num_workers | integer | - | |
|
| opt_func | untyped | - | - | |
| patience | integer | 1 | |
|
| pin_memory | logical | TRUE | TRUE, FALSE | - |
| procs | untyped | NULL | - | |
| ps | untyped | NULL | - | |
| shuffle | logical | FALSE | TRUE, FALSE | - |
| train_bn | logical | TRUE | TRUE, FALSE | - |
| wd | integer | - | |
|
| wd_bn_bias | logical | FALSE | TRUE, FALSE | - |
| use_bn | logical | TRUE | TRUE, FALSE | - |
| y_range | untyped | NULL | - | |
| bs | integer | 50 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifFastai
internal_valid_scores(named list() or NULL)
The validation scores extracted from eval_protocol which itself is set by fitting the fastai::tab_learner.
If early stopping is activated, this contains the validation scores of the model for the optimal n_epoch,
otherwise the n_epoch for the final model.
internal_tuned_values(named list() or NULL)
If early stopping is activated, this returns a list with n_epoch,
which is the last epoch that yielded improvement w.r.t. the patience, extracted by max(eval_protocol$epoch)+1
validate(numeric(1) or character(1) or NULL)
How to construct the internal validation data. This parameter can be either NULL,
a ratio, "test", or "predefined".
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifFastai$new()
marshal()
Marshal the learner's model.
LearnerClassifFastai$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifFastai$unmarshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifFastai$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Howard, Jeremy, Gugger, Sylvain (2020). “Fastai: A Layered API for Deep Learning.” Information, 11(2), 108. ISSN 2078-2489, doi:10.3390/info11020108.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Fast Nearest Neighbour Classification.
Calls FNN::knn() from FNN.
This Learner can be instantiated via lrn():
lrn("classif.fnn")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, FNN
| Id | Type | Default | Levels | Range |
| k | integer | 1 | |
|
| algorithm | character | kd_tree | kd_tree, cover_tree, brute | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifFNN
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifFNN$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifFNN$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Boltz, Sylvain, Debreuve, Eric, Barlaud, Michel (2007). “kNN-based high-dimensional Kullback-Leibler distance for tracking.” In Eighth International Workshop on Image Analysis for Multimedia Interactive Services (WIAMIS'07), 16–16. IEEE.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.fnn") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.fnn") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Generalized additive models.
Calls mgcv::gam() from package mgcv with family set to binomial.
Multilabel classification is not implemented yet.
This Learner can be instantiated via lrn():
lrn("classif.gam")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, mgcv
| Id | Type | Default | Levels | Range |
| formula | untyped | - | - | |
| method | character | GCV.Cp | GCV.Cp, GACV.Cp, REML, P-REML, ML, P-ML | - |
| optimizer | untyped | c("outer", "newton") | - | |
| scale | numeric | 0 | |
|
| select | logical | FALSE | TRUE, FALSE | - |
| knots | untyped | NULL | - | |
| sp | untyped | NULL | - | |
| min.sp | untyped | NULL | - | |
| H | untyped | NULL | - | |
| gamma | numeric | 1 | |
|
| paraPen | untyped | NULL | - | |
| G | untyped | NULL | - | |
| in.out | untyped | NULL | - | |
| drop.unused.levels | logical | TRUE | TRUE, FALSE | - |
| drop.intercept | logical | FALSE | TRUE, FALSE | - |
| nei | untyped | - | - | |
| nthreads | integer | 1 | |
|
| irls.reg | numeric | 0 | |
|
| epsilon | numeric | 1e-07 | |
|
| maxit | integer | 200 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| mgcv.tol | numeric | 1e-07 | |
|
| mgcv.half | integer | 15 | |
|
| rank.tol | numeric | 1.490116e-08 | |
|
| nlm | untyped | list() | - | |
| optim | untyped | list() | - | |
| newton | untyped | list() | - | |
| idLinksBases | logical | TRUE | TRUE, FALSE | - |
| scalePenalty | logical | TRUE | TRUE, FALSE | - |
| efs.lspmax | integer | 15 | |
|
| efs.tol | numeric | 0.1 | |
|
| scale.est | character | fletcher | fletcher, pearson, deviance | - |
| edge.correct | logical | FALSE | TRUE, FALSE | - |
| ncv.threads | integer | 1 | |
|
| block.size | integer | 1000 | |
|
| unconditional | logical | FALSE | TRUE, FALSE | - |
A gam formula specific to the task at hand is required for the formula
parameter (see example and ?mgcv::formula.gam). Beware, if no formula is provided, a fallback formula is
used that will make the gam behave like a glm (this behavior is required
for the unit tests). Only features specified in the formula will be used,
superseding columns with col_roles "feature" in the task.
If a Task contains a column with the offset role, it is automatically
incorporated during training via the offset argument in mgcv::gam().
No offset is applied during prediction for this learner.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifGam
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifGam$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifGam$clone(deep = FALSE)
deepWhether to make a deep clone.
pierrecamilleri
Hastie, J T, Tibshirani, J R (2017). Generalized additive models. Routledge.
Wood, Simon (2012). “mgcv: Mixed GAM Computation Vehicle with GCV/AIC/REML smoothness estimation.”
# simple example t = tsk("spam")$filter(1:1000) l = lrn("classif.gam") l$param_set$set_values( formula = type ~ s(george, k = 3) + s(charDollar, k = 3) + s(edu) ) l$train(t) l$model# simple example t = tsk("spam")$filter(1:1000) l = lrn("classif.gam") l$param_set$set_values( formula = type ~ s(george, k = 3) + s(charDollar, k = 3) + s(edu) ) l$train(t) l$model
Fit a generalized additive classification model using a boosting algorithm.
Calls mboost::gamboost() from mboost.
This Learner can be instantiated via lrn():
lrn("classif.gamboost")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, mboost
| Id | Type | Default | Levels | Range |
| baselearner | character | bbs | bbs, bols, btree | - |
| dfbase | integer | 4 | |
|
| family | character | Binomial | Binomial, AdaExp, AUC, custom | - |
| custom.family | untyped | - | - | |
| link | character | logit | logit, probit | - |
| type | character | adaboost | glm, adaboost | - |
| mstop | integer | 100 | |
|
| nu | numeric | 0.1 | |
|
| risk | character | inbag | inbag, oobag, none | - |
| oobweights | untyped | NULL | - | |
| trace | logical | FALSE | TRUE, FALSE | - |
| stopintern | untyped | FALSE | - | |
| na.action | untyped | stats::na.omit | - |
If a Task contains a column with the offset role, it is automatically
incorporated via the offset argument in mboost's training function.
No offset is applied during prediction for this learner.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifGAMBoost
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Create a LearnerClassifGAMBoost object.
LearnerClassifGAMBoost$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifGAMBoost$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Bühlmann, Peter, Yu, Bin (2003). “Boosting with the L 2 loss: regression and classification.” Journal of the American Statistical Association, 98(462), 324–339.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.gamboost") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.gamboost") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Gaussian process for classification.
Calls kernlab::gausspr() from kernlab.
Parameters sigma, degree, scale, offset and order are
added to make tuning kpar easier. If kpar is provided then these
new parameters are ignored. If none are provided then the default
"automatic" is used for kpar.
This Learner can be instantiated via lrn():
lrn("classif.gausspr")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, kernlab
| Id | Type | Default | Levels | Range |
| scaled | untyped | TRUE | - | |
| kernel | character | rbfdot | rbfdot, polydot, vanilladot, tanhdot, laplacedot, besseldot, anovadot, splinedot | - |
| sigma | numeric | - | |
|
| degree | numeric | - | |
|
| scale | numeric | - | |
|
| offset | numeric | - | |
|
| order | numeric | - | |
|
| kpar | untyped | "automatic" | - | |
| tol | numeric | 0.001 | |
|
| fit | logical | TRUE | TRUE, FALSE | - |
| na.action | untyped | na.omit | - | |
| coupler | character | minpair | minpair, pkpd | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifGausspr
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifGausspr$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifGausspr$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Karatzoglou, Alexandros, Smola, Alex, Hornik, Kurt, Zeileis, Achim (2004). “kernlab-an S4 package for kernel methods in R.” Journal of statistical software, 11(9), 1–20.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.gausspr") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.gausspr") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Gradient Boosting Classification Algorithm.
Calls gbm::gbm() from gbm.
This Learner can be instantiated via lrn():
lrn("classif.gbm")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, gbm
| Id | Type | Default | Levels | Range |
| distribution | character | bernoulli | bernoulli, adaboost, huberized, multinomial | - |
| n.trees | integer | 100 | |
|
| interaction.depth | integer | 1 | |
|
| n.minobsinnode | integer | 10 | |
|
| shrinkage | numeric | 0.001 | |
|
| bag.fraction | numeric | 0.5 | |
|
| train.fraction | numeric | 1 | |
|
| cv.folds | integer | 0 | |
|
| keep.data | logical | FALSE | TRUE, FALSE | - |
| verbose | logical | FALSE | TRUE, FALSE | - |
| n.cores | integer | 1 | |
|
| var.monotone | untyped | - | - |
keep.data is initialized to FALSE to save memory.
n.cores is initialized to 1 to avoid conflicts with parallelization through future.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifGBM
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifGBM$new()
importance()
The importance scores are extracted by gbm::relative.influence() from
the model.
LearnerClassifGBM$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerClassifGBM$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Friedman, H J (2002). “Stochastic gradient boosting.” Computational statistics & data analysis, 38(4), 367–378.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.gbm") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.gbm") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Fit a generalized linear classification model using a boosting algorithm.
Calls mboost::glmboost() from mboost.
This Learner can be instantiated via lrn():
lrn("classif.glmboost")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, mboost
| Id | Type | Default | Levels | Range |
| family | character | Binomial | Binomial, AdaExp, AUC, custom | - |
| custom.family | untyped | - | - | |
| link | character | logit | logit, probit | - |
| type | character | adaboost | glm, adaboost | - |
| center | logical | TRUE | TRUE, FALSE | - |
| mstop | integer | 100 | |
|
| nu | numeric | 0.1 | |
|
| risk | character | inbag | inbag, oobag, none | - |
| oobweights | untyped | NULL | - | |
| trace | logical | FALSE | TRUE, FALSE | - |
| stopintern | untyped | FALSE | - | |
| na.action | untyped | stats::na.omit | - | |
| contrasts.arg | untyped | - | - |
If a Task contains a column with the offset role, it is automatically
incorporated via the offset argument in mboost's training function.
No offset is applied during prediction for this learner.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifGLMBoost
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Create a LearnerClassifGLMBoost object.
LearnerClassifGLMBoost$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifGLMBoost$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Bühlmann, Peter, Yu, Bin (2003). “Boosting with the L 2 loss: regression and classification.” Journal of the American Statistical Association, 98(462), 324–339.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.glmboost") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.glmboost") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Generalized linear model with random effects.
Calls lme4::glmer() from lme4.
family - Is set to stats::binomial(link = "logit").
Although most mlr3 learners don't allow to specify the formula manually, and automatically
set it by valling task$formula(), this learner allows to set the formula because it's core
functionality depends it. This means that it might not always use all features that are available
in the task.
Be aware, that this can sometimes lead to unexpected error messages,
because mlr3 checks the compatibility between the learner and the task on all available features.
This Learner can be instantiated via lrn():
lrn("classif.glmer")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”
| Id | Type | Default | Levels | Range |
| formula | untyped | - | - | |
| start | untyped | NULL | - | |
| verbose | integer | 0 | |
|
| contrasts | untyped | NULL | - | |
| optimizer | character | - | Nelder_Mead, bobyqa, nlminbwrap, nloptwrap | - |
| restart_edge | logical | FALSE | TRUE, FALSE | - |
| boundary.tol | numeric | 1e-05 | |
|
| calc.derivs | logical | TRUE | TRUE, FALSE | - |
| autoscale | untyped | NULL | - | |
| check.nobs.vs.rankZ | character | ignore | ignore, warning, message, stop | - |
| check.nobs.vs.nlev | character | stop | ignore, warning, message, stop | - |
| check.nlev.gtreq.5 | character | ignore | ignore, warning, message, stop | - |
| check.nlev.gtr.1 | character | stop | ignore, warning, message, stop | - |
| check.nobs.vs.nRE | character | stop | ignore, warning, message, stop | - |
| check.rankX | character | message+drop.cols | message+drop.cols, silent.drop.cols, warn+drop.cols, stop.deficient, ignore | - |
| check.scaleX | character | warning | warning, stop, silent.rescale, message+rescale, warn+rescale, ignore | - |
| check.formula.LHS | character | stop | ignore, warning, message, stop | - |
| family | untyped | "stats::binomial(link = \"logit\")" | - | |
| nAGQ | integer | 1 | |
|
| mustart | untyped | - | - | |
| etastart | untyped | - | - | |
| check.conv.nobsmax | numeric | 10000 | |
|
| check.conv.nparmax | numeric | 20 | |
|
| check.conv.grad | untyped | "lme4::.makeCC(\"warning\", tol = 2e-3, relTol = NULL)" | - | |
| check.conv.singular | untyped | "lme4::.makeCC( action = \"message\", tol = formals(lme4::isSingular)$tol)" | - | |
| check.conv.hess | untyped | "lme4::.makeCC(action = \"warning\", tol = 1e-6)" | - | |
| optCtrl | untyped | list() | - | |
| tolPwrss | untyped | - | - | |
| compDev | logical | TRUE | TRUE, FALSE | - |
| nAGQ0initStep | logical | TRUE | TRUE, FALSE | - |
| check.response.not.const | untyped | "stop" | - | |
| newparams | untyped | NULL | - | |
| re.form | untyped | NULL | - | |
| random.only | logical | FALSE | TRUE, FALSE | - |
| allow.new.levels | logical | FALSE | TRUE, FALSE | - |
| na.action | untyped | "stats::na.pass" | - |
If a Task contains a column with the offset role, it is automatically
incorporated during training via the offset argument in lme4::lmer().
No offset is applied during prediction for this learner.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifGlmer
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifGlmer$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifGlmer$clone(deep = FALSE)
deepWhether to make a deep clone.
sebffischer
Bates, M D (2010). “lme4: Mixed-effects modeling with R.”
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner and set parameter values learner = lrn("classif.glmer", formula = credit_risk ~ (1 | credit_history) + job + property + telephone + savings) # Define a Task task = tsk("german_credit") task$select(c("credit_history", "job", "property", "telephone", "savings")) # Train the learner learner$train(task) print(learner$model)# Define the Learner and set parameter values learner = lrn("classif.glmer", formula = credit_risk ~ (1 | credit_history) + job + property + telephone + savings) # Define a Task task = tsk("german_credit") task$select(c("credit_history", "job", "property", "telephone", "savings")) # Train the learner learner$train(task) print(learner$model)
Classification feed-forward multilayer artificial neural network learner.
Class h2o::h2o.deeplearning() from package h2o.
This Learner can be instantiated via lrn():
lrn("classif.h2o.deeplearning")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, h2o
| Id | Type | Default | Levels | Range |
| activation | character | Rectifier | Rectifier, Tanh, TanhWithDropout, RectifierWithDropout, Maxout, MaxoutWithDropout | - |
| adaptive_rate | logical | TRUE | TRUE, FALSE | - |
| auc_type | character | AUTO | AUTO, NONE, MACRO_OVR, WEIGHTED_OVR, MACRO_OVO, WEIGHTED_OVO | - |
| autoencoder | logical | FALSE | TRUE, FALSE | - |
| average_activation | numeric | 0 | |
|
| balance_classes | logical | FALSE | TRUE, FALSE | - |
| categorical_encoding | character | AUTO | AUTO, Enum, OneHotInternal, OneHotExplicit, Binary, Eigen, LabelEncoder, SortByResponse, EnumLimited | - |
| checkpoint | untyped | NULL | - | |
| class_sampling_factors | untyped | NULL | - | |
| classification_stop | numeric | 0 | |
|
| diagnostics | logical | TRUE | TRUE, FALSE | - |
| distribution | character | AUTO | AUTO, bernoulli, multinomial | - |
| elastic_averaging | logical | FALSE | TRUE, FALSE | - |
| elastic_averaging_moving_rate | numeric | 0.9 | |
|
| elastic_averaging_regularization | numeric | 0.001 | |
|
| epochs | numeric | 10 | |
|
| epsilon | numeric | 1e-08 | |
|
| export_checkpoints_dir | untyped | NULL | - | |
| export_weights_and_biases | logical | FALSE | TRUE, FALSE | - |
| fast_mode | logical | TRUE | TRUE, FALSE | - |
| force_load_balance | logical | TRUE | TRUE, FALSE | - |
| gainslift_bins | integer | -1 | |
|
| hidden | untyped | c(200L, 200L) | - | |
| hidden_dropout_ratios | numeric | 0.5 | |
|
| ignore_const_cols | logical | TRUE | TRUE, FALSE | - |
| initial_weight_distribution | character | UniformAdaptive | UniformAdaptive, Uniform, Normal | - |
| initial_weight_scale | numeric | 1 | |
|
| input_dropout_ratio | numeric | 0 | |
|
| l1 | numeric | 0 | |
|
| l2 | numeric | 0 | |
|
| loss | character | Automatic | Automatic, CrossEntropy, Quadratic | - |
| max_after_balance_size | numeric | 5 | |
|
| max_categorical_features | integer | NULL | |
|
| max_runtime_secs | numeric | 0 | |
|
| max_w2 | numeric | 3.402823e+38 | |
|
| mini_batch_size | integer | 1 | |
|
| missing_values_handling | character | MeanImputation | MeanImputation, Skip | - |
| momentum_ramp | numeric | 1e+06 | |
|
| momentum_stable | numeric | 0 | |
|
| momentum_start | numeric | 0 | |
|
| nesterov_accelerated_gradient | logical | TRUE | TRUE, FALSE | - |
| overwrite_with_best_model | logical | TRUE | TRUE, FALSE | - |
| pretrained_autoencoder | untyped | NULL | - | |
| quiet_mode | logical | TRUE | TRUE, FALSE | - |
| rate | numeric | 0.005 | |
|
| rate_annealing | numeric | 1e-06 | |
|
| rate_decay | numeric | 1 | |
|
| replicate_training_data | logical | TRUE | TRUE, FALSE | - |
| reproducible | logical | FALSE | TRUE, FALSE | - |
| rho | numeric | 0.99 | |
|
| score_duty_cycle | numeric | 0.1 | |
|
| score_each_iteration | logical | FALSE | TRUE, FALSE | - |
| score_interval | numeric | 5 | |
|
| score_training_samples | integer | 10000 | |
|
| score_validation_samples | integer | 0 | |
|
| score_validation_sampling | character | Uniform | Uniform, Stratified | - |
| seed | integer | -1 | |
|
| shuffle_training_data | logical | FALSE | TRUE, FALSE | - |
| single_node_mode | logical | FALSE | TRUE, FALSE | - |
| sparse | logical | FALSE | TRUE, FALSE | - |
| sparsity_beta | numeric | 0 | |
|
| standardize | logical | TRUE | TRUE, FALSE | - |
| stopping_metric | character | AUTO | AUTO, logloss, AUC, lift_top_group, misclassification, AUCPR, mean_per_class_error | - |
| stopping_rounds | integer | 5 | |
|
| stopping_tolerance | numeric | 0 | |
|
| target_ratio_comm_to_comp | numeric | 0.05 | |
|
| train_samples_per_iteration | integer | -2 | |
|
| verbose | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifH2ODeeplearning
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifH2ODeeplearning$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifH2ODeeplearning$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Fryda T, LeDell E, Gill N, Aiello S, Fu A, Candel A, Click C, Kraljevic T, Nykodym T, Aboyoun P, Kurka M, Malohlava M, Poirier S, Wong W (2025). h2o: R Interface for the 'H2O' Scalable Machine Learning Platform. R package version 3.46.0.9, https://github.com/h2oai/h2o-3.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.h2o.deeplearning", epochs = 1) print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.h2o.deeplearning", epochs = 1) print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Gradient boosting machine learner.
Class h2o::h2o.gbm() from package h2o.
This Learner can be instantiated via lrn():
lrn("classif.h2o.gbm")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, h2o
| Id | Type | Default | Levels | Range |
| auc_type | character | AUTO | AUTO, NONE, MACRO_OVR, WEIGHTED_OVR, MACRO_OVO, WEIGHTED_OVO | - |
| auto_rebalance | logical | TRUE | TRUE, FALSE | - |
| balance_classes | logical | FALSE | TRUE, FALSE | - |
| build_tree_one_node | logical | FALSE | TRUE, FALSE | - |
| categorical_encoding | character | AUTO | AUTO, Enum, OneHotInternal, OneHotExplicit, Binary, Eigen, LabelEncoder, SortByResponse, EnumLimited | - |
| check_constant_response | logical | TRUE | TRUE, FALSE | - |
| checkpoint | untyped | NULL | - | |
| class_sampling_factors | untyped | NULL | - | |
| col_sample_rate | numeric | 1 | |
|
| col_sample_rate_change_per_level | numeric | 1 | |
|
| col_sample_rate_per_tree | numeric | 1 | |
|
| export_checkpoints_dir | untyped | NULL | - | |
| gainslift_bins | integer | -1 | |
|
| histogram_type | character | AUTO | AUTO, UniformAdaptive, Random, QuantilesGlobal, RoundRobin, UniformRobust | - |
| ignore_const_cols | logical | TRUE | TRUE, FALSE | - |
| in_training_checkpoints_dir | untyped | NULL | - | |
| in_training_checkpoints_tree_interval | integer | 1 | |
|
| interaction_constraints | untyped | NULL | - | |
| learn_rate | numeric | 0.1 | |
|
| learn_rate_annealing | numeric | 1 | |
|
| max_abs_leafnode_pred | numeric | Inf | |
|
| max_after_balance_size | numeric | 5 | |
|
| max_depth | integer | 5 | |
|
| max_runtime_secs | numeric | 0 | |
|
| min_rows | integer | 10 | |
|
| min_split_improvement | numeric | 1e-05 | |
|
| monotone_constraints | untyped | NULL | - | |
| nbins | integer | 20 | |
|
| nbins_cats | integer | 1024 | |
|
| nbins_top_level | integer | 1024 | |
|
| ntrees | integer | 50 | |
|
| pred_noise_bandwidth | numeric | 0 | |
|
| sample_rate | numeric | 1 | |
|
| sample_rate_per_class | untyped | NULL | - | |
| score_each_iteration | logical | FALSE | TRUE, FALSE | - |
| score_tree_interval | integer | 0 | |
|
| seed | integer | -1 | |
|
| stopping_metric | character | AUTO | AUTO, logloss, AUC, AUCPR, lift_top_group, misclassification, mean_per_class_error | - |
| stopping_rounds | integer | 0 | |
|
| stopping_tolerance | numeric | 0.001 | |
|
| verbose | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifH2OGBM
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifH2OGBM$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifH2OGBM$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Fryda T, LeDell E, Gill N, Aiello S, Fu A, Candel A, Click C, Kraljevic T, Nykodym T, Aboyoun P, Kurka M, Malohlava M, Poirier S, Wong W (2025). h2o: R Interface for the 'H2O' Scalable Machine Learning Platform. R package version 3.46.0.9, https://github.com/h2oai/h2o-3.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.h2o.gbm") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.h2o.gbm") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Generalized linear classification model.
Calls h2o::h2o.glm() from package h2o with family always set to "binomial".
If no running H2O connection is found, the learner will automatically start a local H2O server
on 127.0.0.1 via h2o::h2o.init().
If you want to connect to a remote H2O cluster, call h2o::h2o.init() with the appropriate
arguments before training or predicting.
This Learner can be instantiated via lrn():
lrn("classif.h2o.glm")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, h2o
| Id | Type | Default | Levels | Range |
| alpha | numeric | 0.5 | |
|
| balance_classes | logical | FALSE | TRUE, FALSE | - |
| beta_constraints | untyped | NULL | - | |
| beta_epsilon | numeric | 1e-04 | |
|
| build_null_model | logical | FALSE | TRUE, FALSE | - |
| calc_like | logical | FALSE | TRUE, FALSE | - |
| checkpoint | untyped | NULL | - | |
| class_sampling_factors | untyped | NULL | - | |
| cold_start | logical | FALSE | TRUE, FALSE | - |
| compute_p_values | logical | FALSE | TRUE, FALSE | - |
| early_stopping | logical | TRUE | TRUE, FALSE | - |
| export_checkpoints_dir | untyped | NULL | - | |
| gainslift_bins | integer | -1 | |
|
| generate_scoring_history | logical | FALSE | TRUE, FALSE | - |
| generate_variable_inflation_factors | logical | FALSE | TRUE, FALSE | - |
| gradient_epsilon | numeric | -1 | |
|
| HGLM | logical | FALSE | TRUE, FALSE | - |
| ignore_const_cols | logical | TRUE | TRUE, FALSE | - |
| interactions | untyped | NULL | - | |
| interaction_pairs | untyped | NULL | - | |
| intercept | logical | TRUE | TRUE, FALSE | - |
| lambda | numeric | 1e-05 | |
|
| lambda_min_ratio | numeric | -1 | |
|
| lambda_search | logical | FALSE | TRUE, FALSE | - |
| link | character | logit | family_default, logit | - |
| max_active_predictors | integer | -1 | |
|
| max_after_balance_size | numeric | 5 | |
|
| max_iterations | integer | -1 | |
|
| max_runtime_secs | numeric | 0 | |
|
| missing_values_handling | character | MeanImputation | MeanImputation, Skip, PlugValues | - |
| nlambdas | integer | -1 | |
|
| non_negative | logical | FALSE | TRUE, FALSE | - |
| objective_epsilon | numeric | -1 | |
|
| obj_reg | numeric | -1 | |
|
| plug_values | untyped | NULL | - | |
| prior | numeric | -1 | |
|
| random_columns | untyped | NULL | - | |
| remove_collinear_columns | logical | FALSE | TRUE, FALSE | - |
| score_each_iteration | logical | FALSE | TRUE, FALSE | - |
| score_iteration_interval | integer | -1 | |
|
| seed | integer | -1 | |
|
| solver | character | AUTO | AUTO, IRLSM, L_BFGS, COORDINATE_DESCENT, COORDINATE_DESCENT_NAIVE | - |
| standardize | logical | TRUE | TRUE, FALSE | - |
| startval | untyped | NULL | - | |
| stopping_metric | character | AUTO | AUTO, logloss, AUC, AUCPR, lift_top_group, misclassification, mean_per_class_error | - |
| stopping_rounds | integer | 0 | |
|
| stopping_tolerance | numeric | 0.001 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifH2OGLM
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifH2OGLM$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifH2OGLM$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Fryda T, LeDell E, Gill N, Aiello S, Fu A, Candel A, Click C, Kraljevic T, Nykodym T, Aboyoun P, Kurka M, Malohlava M, Poirier S, Wong W (2025). h2o: R Interface for the 'H2O' Scalable Machine Learning Platform. R package version 3.46.0.9, https://github.com/h2oai/h2o-3.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.h2o.glm") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.h2o.glm") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Classification random forest learner.
Calls h2o::h2o.randomForest() from package h2o.
If no running H2O connection is found, the learner will automatically start a local H2O server
on 127.0.0.1 via h2o::h2o.init().
If you want to connect to a remote H2O cluster, call h2o::h2o.init() with the appropriate
arguments before training or predicting.
This Learner can be instantiated via lrn():
lrn("classif.h2o.randomForest")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, h2o
| Id | Type | Default | Levels | Range |
| auc_type | character | AUTO | AUTO, NONE, MACRO_OVR, WEIGHTED_OVR, MACRO_OVO, WEIGHTED_OVO | - |
| balance_classes | logical | FALSE | TRUE, FALSE | - |
| binomial_double_trees | logical | FALSE | TRUE, FALSE | - |
| build_tree_one_node | logical | FALSE | TRUE, FALSE | - |
| categorical_encoding | character | AUTO | AUTO, Enum, OneHotInternal, OneHotExplicit, Binary, Eigen, LabelEncoder, SortByResponse, EnumLimited | - |
| check_constant_response | logical | TRUE | TRUE, FALSE | - |
| checkpoint | untyped | NULL | - | |
| class_sampling_factors | untyped | NULL | - | |
| col_sample_rate_change_per_level | numeric | 1 | |
|
| col_sample_rate_per_tree | numeric | 1 | |
|
| export_checkpoints_dir | untyped | NULL | - | |
| gainslift_bins | integer | -1 | |
|
| histogram_type | character | AUTO | AUTO, UniformAdaptive, Random, QuantilesGlobal, RoundRobin, UniformRobust | - |
| ignore_const_cols | logical | TRUE | TRUE, FALSE | - |
| max_after_balance_size | numeric | 5 | |
|
| max_depth | integer | 20 | |
|
| max_runtime_secs | numeric | 0 | |
|
| min_rows | numeric | 1 | |
|
| min_split_improvement | numeric | 1e-05 | |
|
| mtries | integer | -1 | |
|
| nbins | integer | 20 | |
|
| nbins_cats | integer | 1024 | |
|
| nbins_top_level | integer | 1024 | |
|
| ntrees | integer | 50 | |
|
| sample_rate | numeric | 0.632 | |
|
| sample_rate_per_class | untyped | NULL | - | |
| score_each_iteration | logical | FALSE | TRUE, FALSE | - |
| score_tree_interval | integer | 0 | |
|
| seed | integer | -1 | |
|
| stopping_metric | character | AUTO | AUTO, logloss, AUC, AUCPR, lift_top_group, misclassification, mean_per_class_error | - |
| stopping_rounds | integer | 0 | |
|
| stopping_tolerance | numeric | 0.001 | |
|
| verbose | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifH2ORandomForest
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifH2ORandomForest$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifH2ORandomForest$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Fryda T, LeDell E, Gill N, Aiello S, Fu A, Candel A, Click C, Kraljevic T, Nykodym T, Aboyoun P, Kurka M, Malohlava M, Poirier S, Wong W (2025). h2o: R Interface for the 'H2O' Scalable Machine Learning Platform. R package version 3.46.0.9, https://github.com/h2oai/h2o-3.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.h2o.randomForest") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.h2o.randomForest") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Instance based algorithm: K-nearest neighbours regression.
Calls RWeka::IBk() from RWeka.
This Learner can be instantiated via lrn():
lrn("classif.IBk")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, RWeka
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| weight | character | - | I, F | - |
| K | integer | 1 | |
|
| E | logical | FALSE | TRUE, FALSE | - |
| W | integer | 0 | |
|
| X | logical | FALSE | TRUE, FALSE | - |
| A | character | LinearNNSearch | BallTree, CoverTree, FilteredNeighbourSearch, KDTree, LinearNNSearch | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
weight:
original id: I and F
Reason for change: original I and F params are interdependent
(I can only be TRUE when F is FALSE and vice versa).
The easiest way to encode this is to combine I and F into one factor param.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifIBk
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifIBk$new()
marshal()
Marshal the learner's model.
LearnerClassifIBk$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifIBk$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifIBk$clone(deep = FALSE)
deepWhether to make a deep clone.
henrifnk
Aha, W D, Kibler, Dennis, Albert, K M (1991). “Instance-based learning algorithms.” Machine learning, 6(1), 37–66.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.IBk") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.IBk") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Imbalanced Random forest for classification between two classes.
Calls randomForestSRC::imbalanced.rfsrc() from from randomForestSRC.
This Learner can be instantiated via lrn():
lrn("classif.imbalanced_rfsrc")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, randomForestSRC
| Id | Type | Default | Levels | Range |
| ntree | integer | 500 | |
|
| method | character | rfq | rfq, brf, standard | - |
| block.size | integer | 10 | |
|
| fast | logical | FALSE | TRUE, FALSE | - |
| ratio | numeric | - | |
|
| mtry | integer | - | |
|
| mtry.ratio | numeric | - | |
|
| nodesize | integer | 15 | |
|
| nodedepth | integer | - | |
|
| splitrule | character | gini | gini, auc, entropy | - |
| nsplit | integer | 10 | |
|
| importance | character | FALSE | FALSE, TRUE, none, permute, random, anti | - |
| bootstrap | character | by.root | by.root, by.node, none, by.user | - |
| samptype | character | swor | swor, swr | - |
| samp | untyped | - | - | |
| membership | logical | FALSE | TRUE, FALSE | - |
| sampsize | untyped | - | - | |
| sampsize.ratio | numeric | - | |
|
| na.action | character | na.omit | na.omit, na.impute | - |
| nimpute | integer | 1 | |
|
| ntime | integer | - | |
|
| proximity | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| distance | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| forest.wt | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| xvar.wt | untyped | - | - | |
| split.wt | untyped | - | - | |
| forest | logical | TRUE | TRUE, FALSE | - |
| var.used | character | FALSE | FALSE, all.trees | - |
| split.depth | character | FALSE | FALSE, all.trees | - |
| seed | integer | - | |
|
| do.trace | logical | FALSE | TRUE, FALSE | - |
| get.tree | untyped | - | - | |
| outcome | character | train | train, test | - |
| ptn.count | integer | 0 | |
|
| cores | integer | 1 | |
|
| save.memory | logical | FALSE | TRUE, FALSE | - |
| perf.type | character | - | gmean, misclass, brier, none | - |
| case.depth | logical | FALSE | TRUE, FALSE | - |
| marginal.xvar | untyped | NULL | - |
mtry: This hyperparameter can alternatively be set via the added
hyperparameter mtry.ratio as mtry = max(ceiling(mtry.ratio * n_features), 1).
Note that mtry and mtry.ratio are mutually exclusive.
sampsize: This hyperparameter can alternatively be set via the added
hyperparameter sampsize.ratio as sampsize = max(ceiling(sampsize.ratio * n_obs), 1).
Note that sampsize and sampsize.ratio are mutually exclusive.
cores: This value is set as the option rf.cores during training and is
set to 1 by default.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifImbalancedRandomForestSRC
new()
Creates a new instance of this R6 class.
LearnerClassifImbalancedRandomForestSRC$new()
importance()
The importance scores are extracted from the slot importance.
LearnerClassifImbalancedRandomForestSRC$importance()
Named numeric().
selected_features()
Selected features are extracted from the model slot var.used.
Note: Due to a known issue in randomForestSRC, enabling var.used = "all.trees"
causes prediction to fail. Therefore, this setting should be used exclusively
for feature selection purposes and not when prediction is required.
LearnerClassifImbalancedRandomForestSRC$selected_features()
character().
oob_error()
OOB error extracted from the model slot err.rate.
LearnerClassifImbalancedRandomForestSRC$oob_error()
numeric().
clone()
The objects of this class are cloneable with this method.
LearnerClassifImbalancedRandomForestSRC$clone(deep = FALSE)
deepWhether to make a deep clone.
HarutyunyanLiana
O’Brien R, Ishwaran H (2019). “A random forests quantile classifier for class imbalanced data.” Pattern Recognition, 90, 232–249. doi:10.1016/j.patcog.2019.01.036.
Chao C, Leo B (2004). “Using Random Forest to Learn Imbalanced Data.” University of California, Berkeley.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.imbalanced_rfsrc", importance = "TRUE") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.imbalanced_rfsrc", importance = "TRUE") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Decision tree algorithm.
Calls RWeka::IBk() from RWeka.
This Learner can be instantiated via lrn():
lrn("classif.J48")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, RWeka
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| U | logical | FALSE | TRUE, FALSE | - |
| O | logical | FALSE | TRUE, FALSE | - |
| C | numeric | 0.25 | |
|
| M | integer | 2 | |
|
| R | logical | FALSE | TRUE, FALSE | - |
| N | integer | 3 | |
|
| B | logical | FALSE | TRUE, FALSE | - |
| S | logical | FALSE | TRUE, FALSE | - |
| L | logical | FALSE | TRUE, FALSE | - |
| A | logical | FALSE | TRUE, FALSE | - |
| J | logical | FALSE | TRUE, FALSE | - |
| Q | integer | 1 | |
|
| doNotMakeSplitPointActualValue | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifJ48
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifJ48$new()
marshal()
Marshal the learner's model.
LearnerClassifJ48$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifJ48$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifJ48$clone(deep = FALSE)
deepWhether to make a deep clone.
henrifnk
Quinlan, Ross J (2014). C4. 5: programs for machine learning. Elsevier.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.J48") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.J48") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Repeated Incremental Pruning to Produce Error Reduction.
Calls RWeka::JRip() from RWeka.
This Learner can be instantiated via lrn():
lrn("classif.JRip")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, RWeka
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| F | integer | 3 | |
|
| N | numeric | 2 | |
|
| O | integer | 2 | |
|
| D | logical | FALSE | TRUE, FALSE | - |
| S | integer | 1 | |
|
| E | logical | FALSE | TRUE, FALSE | - |
| P | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifJRip
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifJRip$new()
marshal()
Marshal the learner's model.
LearnerClassifJRip$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifJRip$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifJRip$clone(deep = FALSE)
deepWhether to make a deep clone.
henrifnk
Cohen, W W (1995). “Fast effective rule induction.” In Machine learning proceedings 1995, 115–123. Elsevier.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.JRip") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.JRip") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
K-nearest neighbor classification.
Calls class::knn() from class.
This Learner can be instantiated via lrn():
lrn("classif.knn")
Task type: “classif”
Predict Types: “response”
Feature Types: “numeric”
| Id | Type | Default | Levels | Range |
| k | integer | 1 | |
|
| l | numeric | 0 | |
|
| prob | logical | FALSE | TRUE, FALSE | - |
| use.all | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifKnn
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifKnn$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifKnn$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Venables WN, Ripley BD (2002). Modern Applied Statistics with S, Fourth edition. Springer, New York. ISBN 0-387-95457-0, https://www.stats.ox.ac.uk/pub/MASS4/.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.knn") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.knn") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Instance-based classifier which differs from other instance-based learners in that
it uses an entropy-based distance function.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("classif.kstar")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| B | integer | 20 | |
|
| E | logical | - | TRUE, FALSE | - |
| M | character | a | a, d, m, n | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifKStar
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifKStar$new()
marshal()
Marshal the learner's model.
LearnerClassifKStar$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifKStar$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifKStar$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Cleary JG, Trigg LE (1995). “K*: An Instance-based Learner Using an Entropic Distance Measure.” In 12th International Conference on Machine Learning, 108-114.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.kstar") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.kstar") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Support vector machine for classification.
Calls kernlab::ksvm() from kernlab.
This Learner can be instantiated via lrn():
lrn("classif.ksvm")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, kernlab
| Id | Type | Default | Levels | Range |
| scaled | logical | TRUE | TRUE, FALSE | - |
| type | character | C-svc | C-svc, nu-svc, C-bsvc, spoc-svc, kbb-svc | - |
| kernel | character | rbfdot | rbfdot, polydot, vanilladot, laplacedot, besseldot, anovadot | - |
| C | numeric | 1 | |
|
| nu | numeric | 0.2 | |
|
| cache | integer | 40 | |
|
| tol | numeric | 0.001 | |
|
| shrinking | logical | TRUE | TRUE, FALSE | - |
| sigma | numeric | - | |
|
| degree | integer | - | |
|
| scale | numeric | - | |
|
| order | integer | - | |
|
| offset | numeric | - | |
|
| coupler | character | minpair | minpair, pkpd | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifKSVM
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifKSVM$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifKSVM$clone(deep = FALSE)
deepWhether to make a deep clone.
mboecker
Karatzoglou, Alexandros, Smola, Alex, Hornik, Kurt, Zeileis, Achim (2004). “kernlab-an S4 package for kernel methods in R.” Journal of statistical software, 11(9), 1–20.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.ksvm") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.ksvm") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
L2 regularized support vector classification.
Calls LiblineaR::LiblineaR() from LiblineaR.
Type of SVC depends on type argument:
0 – L2-regularized logistic regression (primal)
1 - L2-regularized L2-loss support vector classification (dual)
3 - L2-regularized L1-loss support vector classification (dual)
2 – L2-regularized L2-loss support vector classification (primal)
4 – Support vector classification by Crammer and Singer
5 - L1-regularized L2-loss support vector classification
6 - L1-regularized logistic regression
7 - L2-regularized logistic regression (dual)
If number of records > number of features, type = 2 is faster than type = 1
(Hsu et al. 2003).
Note that probabilistic predictions are only available for types 0, 6, and 7.
The default epsilon value depends on the type parameter, see LiblineaR::LiblineaR().
This Learner can be instantiated via lrn():
lrn("classif.liblinear")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “numeric”
Required Packages: mlr3, mlr3extralearners, LiblineaR
| Id | Type | Default | Levels | Range |
| type | integer | 0 | |
|
| cost | numeric | 1 | |
|
| epsilon | numeric | - | |
|
| bias | numeric | 1 | |
|
| cross | integer | 0 | |
|
| verbose | logical | FALSE | TRUE, FALSE | - |
| wi | untyped | NULL | - | |
| findC | logical | FALSE | TRUE, FALSE | - |
| useInitC | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifLiblineaR
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifLiblineaR$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifLiblineaR$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Fan, Rong-En, Chang, Kai-Wei, Hsieh, Cho-Jui, Wang, Xiang-Rui, Lin, Chih-Jen (2008). “LIBLINEAR: A library for large linear classification.” the Journal of machine Learning research, 9, 1871–1874.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.liblinear") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.liblinear") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Gradient boosting algorithm.
Calls lightgbm::lightgbm() from lightgbm.
The list of parameters can be found here
and in the documentation of lightgbm::lgb.train().
This Learner can be instantiated via lrn():
lrn("classif.lightgbm")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, lightgbm
| Id | Type | Default | Levels | Range |
| objective | character | - | binary, multiclass, multiclassova | - |
| eval | untyped | - | - | |
| verbose | integer | 1 | |
|
| record | logical | TRUE | TRUE, FALSE | - |
| eval_freq | integer | 1 | |
|
| callbacks | untyped | - | - | |
| reset_data | logical | FALSE | TRUE, FALSE | - |
| boosting | character | gbdt | gbdt, rf, dart, goss | - |
| linear_tree | logical | FALSE | TRUE, FALSE | - |
| learning_rate | numeric | 0.1 | |
|
| num_leaves | integer | 31 | |
|
| tree_learner | character | serial | serial, feature, data, voting | - |
| num_threads | integer | 0 | |
|
| device_type | character | cpu | cpu, gpu | - |
| seed | integer | - | |
|
| deterministic | logical | FALSE | TRUE, FALSE | - |
| data_sample_strategy | character | bagging | bagging, goss | - |
| force_col_wise | logical | FALSE | TRUE, FALSE | - |
| force_row_wise | logical | FALSE | TRUE, FALSE | - |
| histogram_pool_size | numeric | -1 | |
|
| max_depth | integer | -1 | |
|
| min_data_in_leaf | integer | 20 | |
|
| min_sum_hessian_in_leaf | numeric | 0.001 | |
|
| bagging_fraction | numeric | 1 | |
|
| pos_bagging_fraction | numeric | 1 | |
|
| neg_bagging_fraction | numeric | 1 | |
|
| bagging_freq | integer | 0 | |
|
| bagging_seed | integer | 3 | |
|
| bagging_by_query | logical | FALSE | TRUE, FALSE | - |
| feature_fraction | numeric | 1 | |
|
| feature_fraction_bynode | numeric | 1 | |
|
| feature_fraction_seed | integer | 2 | |
|
| extra_trees | logical | FALSE | TRUE, FALSE | - |
| extra_seed | integer | 6 | |
|
| max_delta_step | numeric | 0 | |
|
| lambda_l1 | numeric | 0 | |
|
| lambda_l2 | numeric | 0 | |
|
| linear_lambda | numeric | 0 | |
|
| min_gain_to_split | numeric | 0 | |
|
| drop_rate | numeric | 0.1 | |
|
| max_drop | integer | 50 | |
|
| skip_drop | numeric | 0.5 | |
|
| xgboost_dart_mode | logical | FALSE | TRUE, FALSE | - |
| uniform_drop | logical | FALSE | TRUE, FALSE | - |
| drop_seed | integer | 4 | |
|
| top_rate | numeric | 0.2 | |
|
| other_rate | numeric | 0.1 | |
|
| min_data_per_group | integer | 100 | |
|
| max_cat_threshold | integer | 32 | |
|
| cat_l2 | numeric | 10 | |
|
| cat_smooth | numeric | 10 | |
|
| max_cat_to_onehot | integer | 4 | |
|
| top_k | integer | 20 | |
|
| monotone_constraints | untyped | NULL | - | |
| monotone_constraints_method | character | basic | basic, intermediate, advanced | - |
| monotone_penalty | numeric | 0 | |
|
| feature_contri | untyped | NULL | - | |
| forcedsplits_filename | untyped | "" | - | |
| refit_decay_rate | numeric | 0.9 | |
|
| cegb_tradeoff | numeric | 1 | |
|
| cegb_penalty_split | numeric | 0 | |
|
| cegb_penalty_feature_lazy | untyped | - | - | |
| cegb_penalty_feature_coupled | untyped | - | - | |
| path_smooth | numeric | 0 | |
|
| interaction_constraints | untyped | - | - | |
| use_quantized_grad | logical | TRUE | TRUE, FALSE | - |
| num_grad_quant_bins | integer | 4 | |
|
| quant_train_renew_leaf | logical | FALSE | TRUE, FALSE | - |
| stochastic_rounding | logical | TRUE | TRUE, FALSE | - |
| serializable | logical | TRUE | TRUE, FALSE | - |
| max_bin | integer | 255 | |
|
| max_bin_by_feature | untyped | NULL | - | |
| min_data_in_bin | integer | 3 | |
|
| bin_construct_sample_cnt | integer | 200000 | |
|
| data_random_seed | integer | 1 | |
|
| is_enable_sparse | logical | TRUE | TRUE, FALSE | - |
| enable_bundle | logical | TRUE | TRUE, FALSE | - |
| use_missing | logical | TRUE | TRUE, FALSE | - |
| zero_as_missing | logical | FALSE | TRUE, FALSE | - |
| feature_pre_filter | logical | TRUE | TRUE, FALSE | - |
| pre_partition | logical | FALSE | TRUE, FALSE | - |
| two_round | logical | FALSE | TRUE, FALSE | - |
| forcedbins_filename | untyped | "" | - | |
| is_unbalance | logical | FALSE | TRUE, FALSE | - |
| scale_pos_weight | numeric | 1 | |
|
| sigmoid | numeric | 1 | |
|
| boost_from_average | logical | TRUE | TRUE, FALSE | - |
| eval_at | untyped | 1:5 | - | |
| multi_error_top_k | integer | 1 | |
|
| auc_mu_weights | untyped | NULL | - | |
| num_machines | integer | 1 | |
|
| local_listen_port | integer | 12400 | |
|
| time_out | integer | 120 | |
|
| machines | untyped | "" | - | |
| gpu_platform_id | integer | -1 | |
|
| gpu_device_id | integer | -1 | |
|
| gpu_device_id_list | untyped | NULL | - | |
| gpu_use_dp | logical | FALSE | TRUE, FALSE | - |
| num_gpu | integer | 1 | |
|
| start_iteration_predict | integer | 0 | |
|
| num_iteration_predict | integer | -1 | |
|
| pred_early_stop | logical | FALSE | TRUE, FALSE | - |
| pred_early_stop_freq | integer | 10 | |
|
| pred_early_stop_margin | numeric | 10 | |
|
| num_iterations | integer | 100 | |
|
| early_stopping_rounds | integer | - | |
|
| early_stopping_min_delta | numeric | - | |
|
| first_metric_only | logical | FALSE | TRUE, FALSE | - |
num_threads:
Actual default: 0L
Initial value: 1L
Reason for change: Prevents accidental conflicts with future.
verbose:
Actual default: 1L
Initial value: -1L
Reason for change: Prevents accidental conflicts with mlr messaging system.
objective:
Depends on the task: if binary classification, then this parameter is set to
"binary", otherwise "multiclasss" and cannot be changed.
num_class:
This parameter is automatically inferred for multiclass tasks and does not have to be set.
Early stopping can be used to find the optimal number of boosting rounds.
Set early_stopping_rounds to an integer value to monitor the performance of the model on the validation set while training.
For information on how to configure the validation set, see the Validation section of mlr3::Learner.
The internal validation measure can be set the eval parameter which should be a list of mlr3::Measures, functions, or strings for the internal lightgbm measures.
If first_metric_only = FALSE (default), the learner stops when any metric fails to improve.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifLightGBM
internal_valid_scoresThe last observation of the validation scores for all metrics.
Extracted from model$evaluation_log
internal_tuned_valuesReturns the early stopped iterations if early_stopping_rounds was set during training.
validateHow to construct the internal validation data. This parameter can be either NULL, a ratio, "test", or "predefined".
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifLightGBM$new()
importance()
The importance scores are extracted from lbg.importance.
LearnerClassifLightGBM$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerClassifLightGBM$clone(deep = FALSE)
deepWhether to make a deep clone.
kapsner
Ke, Guolin, Meng, Qi, Finley, Thomas, Wang, Taifeng, Chen, Wei, Ma, Weidong, Ye, Qiwei, Liu, Tie-Yan (2017). “Lightgbm: A highly efficient gradient boosting decision tree.” Advances in neural information processing systems, 30.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.lightgbm") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.lightgbm") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Classification tree with logistic regression models at the leaves.
Calls RWeka::LMT() from RWeka.
This Learner can be instantiated via lrn():
lrn("classif.LMT")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, RWeka
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| B | logical | FALSE | TRUE, FALSE | - |
| R | logical | FALSE | TRUE, FALSE | - |
| C | logical | FALSE | TRUE, FALSE | - |
| P | logical | FALSE | TRUE, FALSE | - |
| I | integer | - | |
|
| M | integer | 15 | |
|
| W | numeric | 0 | |
|
| A | logical | FALSE | TRUE, FALSE | - |
| doNotMakeSplitPointActualValue | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifLMT
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifLMT$new()
marshal()
Marshal the learner's model.
LearnerClassifLMT$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifLMT$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifLMT$clone(deep = FALSE)
deepWhether to make a deep clone.
henrifnk
Landwehr, Niels, Hall, Mark, Frank, Eibe (2005). “Logistic model trees.” Machine learning, 59(1), 161–205.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.LMT") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.LMT") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Multinomial Logistic Regression model with a ridge estimator.
Calls RWeka::Logistic() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("classif.logistic")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| C | logical | FALSE | TRUE, FALSE | - |
| R | numeric | - | |
|
| M | integer | -1 | |
|
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifLogistic
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifLogistic$new()
marshal()
Marshal the learner's model.
LearnerClassifLogistic$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifLogistic$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifLogistic$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
le Cessie, S., van Houwelingen, J.C. (1992). “Ridge Estimators in Logistic Regression.” Applied Statistics, 41(1), 191-201.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.logistic") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.logistic") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Least squares support vector machine for classification.
Calls kernlab::lssvm() from kernlab.
Parameters sigma, degree, scale, offset, order, length,
lambda, and normalized are added to make tuning kpar easier.
If kpar is provided then these new parameters are ignored. If none are
provided then the default "automatic" is used for kpar.
This Learner can be instantiated via lrn():
lrn("classif.lssvm")
Task type: “classif”
Predict Types: “response”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, kernlab
| Id | Type | Default | Levels | Range |
| scaled | untyped | TRUE | - | |
| kernel | character | rbfdot | rbfdot, polydot, vanilladot, tanhdot, laplacedot, besseldot, anovadot, splinedot, stringdot | - |
| sigma | numeric | - | |
|
| degree | numeric | - | |
|
| scale | numeric | - | |
|
| offset | numeric | - | |
|
| order | numeric | - | |
|
| length | integer | - | |
|
| lambda | numeric | - | |
|
| normalized | logical | - | TRUE, FALSE | - |
| kpar | untyped | "automatic" | - | |
| tau | numeric | 0.01 | |
|
| reduced | logical | TRUE | TRUE, FALSE | - |
| rank | integer | - | |
|
| delta | integer | 40 | |
|
| tol | numeric | 1e-04 | |
|
| fit | logical | TRUE | TRUE, FALSE | - |
| na.action | untyped | na.omit | - | |
| coupler | character | minpair | minpair, pkpd | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifLSSVM
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifLSSVM$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifLSSVM$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Karatzoglou, Alexandros, Smola, Alex, Hornik, Kurt, Zeileis, Achim (2004). “kernlab-an S4 package for kernel methods in R.” Journal of statistical software, 11(9), 1–20.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.lssvm") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.lssvm") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Learning Vector Quantization 1.
Calls class::lvqinit(), class::lvq1(), and class::lvqtest() from class.
This Learner can be instantiated via lrn():
lrn("classif.lvq1")
Task type: “classif”
Predict Types: “response”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, class
| Id | Type | Default | Range |
| alpha | numeric | 0.03 | |
| k | integer | 5 | |
| niter | integer | NULL | |
| prior | untyped | NULL | - |
| size | integer | NULL |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifLvq1
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifLvq1$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifLvq1$clone(deep = FALSE)
deepWhether to make a deep clone.
The learner does not work on tasks with two target groups and one feature.
awinterstetter
Kohonen, Teuvo (1990). “The self-organizing map.” Proceedings of the IEEE, 78(9), 1464–1480. doi:10.1109/5.58325.
Kohonen, Teuvo (1995). Self-Organizing Maps, volume 30 series Springer Series in Information Sciences. Springer, Berlin. ISBN 978-3540967120.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.lvq1") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.lvq1") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Mixture Discriminant Analysis.
Calls mda::mda() from mda.
keep.fitted: Set to FALSE by default for speed.
This Learner can be instantiated via lrn():
lrn("classif.mda")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| criterion | character | misclassification | misclassification, deviance | - |
| dimension | integer | - | |
|
| eps | numeric | 2.220446e-16 | |
|
| iter | integer | 5 | |
|
| keep.fitted | logical | TRUE | TRUE, FALSE | - |
| method | character | polyreg | polyreg, mars, bruto, gen.ridge | - |
| prior | numeric | - | |
|
| start.method | character | kmeans | kmeans, lvq | - |
| sub.df | integer | - | |
|
| subclasses | integer | 2 | |
|
| tot.df | integer | - | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| tries | integer | 5 | |
|
| weights | untyped | - | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifMda
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifMda$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifMda$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.mda") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.mda") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Minimum Distance Empirical Bayesian classification, designed for small-sample, high-dimensional data.
Empirical Bayes estimator where the eigenvalues of the pooled sample covariance matrix are shrunken towards
the identity matrix.
Calls sparsediscrim::lda_emp_bayes() from FIXME: sparsediscrim.
This Learner can be instantiated via lrn():
lrn("classif.mdeb")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, sparsediscrim
| Id | Type | Default |
| prior | untyped | NULL |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifMdeb
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifMdeb$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifMdeb$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Srivastava, M., Kubokawa, T. (2007). “Comparison of Discrimination Methods for High Dimensional Data.” Journal of the Japanese Statistical Association, 37(1), 123–134.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.mdeb") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.mdeb") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Calls RSNNS::mlp() from RSNNS.
This Learner can be instantiated via lrn():
lrn("classif.mlp")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
| Id | Type | Default | Levels | Range |
| hiddenActFunc | untyped | "Act_Logistic" | - | |
| initFunc | untyped | "Randomize_Weights" | - | |
| initFuncParams | untyped | - | - | |
| inputsTest | untyped | - | - | |
| learnFunc | untyped | "Std_Backpropagation" | - | |
| learnFuncParams | untyped | - | - | |
| linOut | logical | FALSE | TRUE, FALSE | - |
| maxit | integer | 100 | |
|
| pruneFunc | untyped | - | - | |
| pruneFuncParams | untyped | - | - | |
| shufflePatterns | logical | TRUE | TRUE, FALSE | - |
| size | untyped | 5L | - | |
| targetsTest | untyped | - | - | |
| updateFunc | untyped | "Topological_Order" | - | |
| updateFuncParams | untyped | - | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifMLP
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifMLP$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifMLP$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Bergmeir, Christoph, Benitez, M. J (2023). “RSNNS: Neural Networks using the Stuttgart Neural Network Simulator (SNNS).” R package version 0.4-17. doi:10.32614/CRAN.package.RSNNS, https://CRAN.R-project.org/package=RSNNS.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.mlp") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.mlp") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Model-based recursive partitioning algorithm.
Calls partykit::mob() from mob.
This Learner can be instantiated via lrn():
lrn("classif.mob")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, partykit, sandwich, coin
| Id | Type | Default | Levels | Range |
| rhs | untyped | - | - | |
| fit | untyped | - | - | |
| offset | untyped | - | - | |
| cluster | untyped | - | - | |
| alpha | numeric | 0.05 | |
|
| bonferroni | logical | TRUE | TRUE, FALSE | - |
| minsize | integer | - | |
|
| minsplit | integer | - | |
|
| minbucket | integer | - | |
|
| maxdepth | integer | Inf | |
|
| mtry | integer | Inf | |
|
| trim | numeric | 0.1 | |
|
| breakties | logical | FALSE | TRUE, FALSE | - |
| parm | untyped | - | - | |
| dfsplit | integer | - | |
|
| prune | untyped | - | - | |
| restart | logical | TRUE | TRUE, FALSE | - |
| verbose | logical | FALSE | TRUE, FALSE | - |
| caseweights | logical | TRUE | TRUE, FALSE | - |
| ytype | character | vector | vector, matrix, data.frame | - |
| xtype | character | matrix | vector, matrix, data.frame | - |
| terminal | untyped | "object" | - | |
| inner | untyped | "object" | - | |
| model | logical | TRUE | TRUE, FALSE | - |
| numsplit | character | left | left, center | - |
| catsplit | character | binary | binary, multiway | - |
| vcov | character | opg | opg, info, sandwich | - |
| ordinal | character | chisq | chisq, max, L2 | - |
| nrep | integer | 10000 | |
|
| applyfun | untyped | - | - | |
| cores | integer | NULL | |
|
| additional | untyped | - | - | |
| predict_fun | untyped | - | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifMob
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifMob$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifMob$clone(deep = FALSE)
deepWhether to make a deep clone.
sumny
Hothorn T, Zeileis A (2015). “partykit: A Modular Toolkit for Recursive Partytioning in R.” Journal of Machine Learning Research, 16(118), 3905-3909. http://jmlr.org/papers/v16/hothorn15a.html.
Hothorn T, Hornik K, Zeileis A (2006). “Unbiased Recursive Partitioning: A Conditional Inference Framework.” Journal of Computational and Graphical Statistics, 15(3), 651–674. doi:10.1198/106186006x133933, https://doi.org/10.1198/106186006x133933.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
library(mlr3) logit_ = function(y, x, start = NULL, weights = NULL, offset = NULL, ...) { glm(y ~ 1, family = binomial, start = start, ...) } learner = LearnerClassifMob$new() learner$param_set$values$rhs = "." learner$param_set$values$fit = logit_ learner$param_set$values$additional = list(maxit = 100) learner$feature_types = c("logical", "integer", "numeric", "factor", "ordered") learner$properties = c("twoclass", "weights") predict_fun = function(object, newdata, task, .type) { p = unname(predict(object, newdata = newdata, type = "response")) levs = task$levels(task$target_names)[[1L]] if (.type == "response") { ifelse(p < 0.5, levs[1L], levs[2L]) } else { y = matrix(c(1 - p, p), ncol = 2L, nrow = length(p)) colnames(y) = levs y } } task = tsk("breast_cancer") learner$param_set$values$predict_fun = predict_fun ids = partition(task) learner$train(task, row_ids = ids$train) learner$predict(task, row_ids = ids$test)library(mlr3) logit_ = function(y, x, start = NULL, weights = NULL, offset = NULL, ...) { glm(y ~ 1, family = binomial, start = start, ...) } learner = LearnerClassifMob$new() learner$param_set$values$rhs = "." learner$param_set$values$fit = logit_ learner$param_set$values$additional = list(maxit = 100) learner$feature_types = c("logical", "integer", "numeric", "factor", "ordered") learner$properties = c("twoclass", "weights") predict_fun = function(object, newdata, task, .type) { p = unname(predict(object, newdata = newdata, type = "response")) levs = task$levels(task$target_names)[[1L]] if (.type == "response") { ifelse(p < 0.5, levs[1L], levs[2L]) } else { y = matrix(c(1 - p, p), ncol = 2L, nrow = length(p)) colnames(y) = levs y } } task = tsk("breast_cancer") learner$param_set$values$predict_fun = predict_fun ids = partition(task) learner$train(task, row_ids = ids$train) learner$predict(task, row_ids = ids$test)
Classifier that uses backpropagation to learn a multi-layer perceptron.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
G removed:
GUI will be opened
Reason for change: The parameter is removed because we don't want to launch GUI.
This Learner can be instantiated via lrn():
lrn("classif.multilayer_perceptron")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| L | numeric | 0.3 | |
|
| M | numeric | 0.2 | |
|
| N | integer | 500 | |
|
| V | numeric | 0 | |
|
| S | integer | 0 | |
|
| E | integer | 20 | |
|
| A | logical | FALSE | TRUE, FALSE | - |
| B | logical | FALSE | TRUE, FALSE | - |
| H | untyped | "a" | - | |
| C | logical | FALSE | TRUE, FALSE | - |
| I | logical | FALSE | TRUE, FALSE | - |
| R | logical | FALSE | TRUE, FALSE | - |
| D | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifMultilayerPerceptron
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifMultilayerPerceptron$new()
marshal()
Marshal the learner's model.
LearnerClassifMultilayerPerceptron$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifMultilayerPerceptron$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifMultilayerPerceptron$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.multilayer_perceptron") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.multilayer_perceptron") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Multinomial Naive Bayes classifier.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
This Learner can be instantiated via lrn():
lrn("classif.naive_bayes_multinomial")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifNaiveBayesMultinomial
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifNaiveBayesMultinomial$new()
marshal()
Marshal the learner's model.
LearnerClassifNaiveBayesMultinomial$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifNaiveBayesMultinomial$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifNaiveBayesMultinomial$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Mccallum A, Nigam K (1998). “A Comparison of Event Models for Naive Bayes Text Classification.” In AAAI-98 Workshop on 'Learning for Text Categorization'.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.naive_bayes_multinomial") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.naive_bayes_multinomial") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Naive Bayes Classifier Using Estimator Classes.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("classif.naive_bayes_weka")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| K | logical | FALSE | TRUE, FALSE | - |
| D | logical | FALSE | TRUE, FALSE | - |
| O | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifNaiveBayesWeka
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifNaiveBayesWeka$new()
marshal()
Marshal the learner's model.
LearnerClassifNaiveBayesWeka$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifNaiveBayesWeka$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifNaiveBayesWeka$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
John GH, Langley P (1995). “Estimating Continuous Distributions in Bayesian Classifiers.” In Eleventh Conference on Uncertainty in Artificial Intelligence, 338-345.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.naive_bayes_weka") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.naive_bayes_weka") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Calls neuralnet::neuralnet() from neuralnet.
err.fct is set to "ce".
linear.output is set to FALSE to perform classification.
act.fct is set to "logistic" for classification.
This Learner can be instantiated via lrn():
lrn("classif.neuralnet")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
| Id | Type | Default | Levels | Range |
| act.fct | untyped | "logistic" | - | |
| algorithm | character | rprop+ | backprop, rprop+, rprop-, sag, slr | - |
| constant.weights | untyped | - | - | |
| err.fct | character | ce | sse, ce | - |
| exclude | untyped | - | - | |
| hidden | untyped | 1L | - | |
| learningrate | numeric | - | |
|
| learningrate.factor | untyped | list(minus = 0.5, plus = 1.2) | - | |
| learningrate.limit | untyped | - | - | |
| lifesign | character | none | none, minimal, full | - |
| lifesign.step | integer | 1000 | |
|
| likelihood | logical | FALSE | TRUE, FALSE | - |
| linear.output | logical | FALSE | TRUE, FALSE | - |
| rep | integer | 1 | |
|
| startweights | untyped | - | - | |
| stepmax | numeric | 1e+05 | |
|
| threshold | numeric | 0.01 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifNeuralnet
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifNeuralnet$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifNeuralnet$clone(deep = FALSE)
deepWhether to make a deep clone.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.neuralnet") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.neuralnet") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Calls deepnet::nn.train() from deepnet.
output is set to "softmax" for probabilistic classification.
This Learner can be instantiated via lrn():
lrn("classif.nnTrain")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
| Id | Type | Default | Levels | Range |
| activationfun | character | sigm | sigm, linear, tanh | - |
| batchsize | integer | 100 | |
|
| hidden | untyped | 10L | - | |
| hidden_dropout | numeric | 0 | |
|
| initB | untyped | - | - | |
| initW | untyped | - | - | |
| learningrate | numeric | 0.8 | |
|
| learningrate_scale | numeric | 1 | |
|
| max_number_of_layers | integer | - | |
|
| momentum | numeric | 0.5 | |
|
| numepochs | integer | 3 | |
|
| output | character | - | sigm, linear, softmax | - |
| visible_dropout | numeric | 0 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifNNTrain
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifNNTrain$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifNNTrain$clone(deep = FALSE)
deepWhether to make a deep clone.
Rong, Xiao (2022). “deepnet: Deep Learning Toolkit in R.” R package version 0.2.1. doi:10.32614/CRAN.package.deepnet, https://CRAN.R-project.org/package=deepnet.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.nnTrain") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.nnTrain") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
One Rule classification algorithm that yields an extremely simple model.
Calls RWeka::OneR() from RWeka.
This Learner can be instantiated via lrn():
lrn("classif.OneR")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, RWeka
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| B | integer | 6 | |
|
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifOneR
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifOneR$new()
marshal()
Marshal the learner's model.
LearnerClassifOneR$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifOneR$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifOneR$clone(deep = FALSE)
deepWhether to make a deep clone.
henrifnk
Holte, C R (1993). “Very simple classification rules perform well on most commonly used datasets.” Machine learning, 11(1), 63–90.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.OneR") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.OneR") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Regression partition tree.
Calls RWeka::PART() from RWeka.
This Learner can be instantiated via lrn():
lrn("classif.PART")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, RWeka
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| C | numeric | 0.25 | |
|
| M | integer | 2 | |
|
| R | logical | FALSE | TRUE, FALSE | - |
| N | integer | 3 | |
|
| B | logical | FALSE | TRUE, FALSE | - |
| U | logical | FALSE | TRUE, FALSE | - |
| J | logical | FALSE | TRUE, FALSE | - |
| Q | integer | 1 | |
|
| doNotMakeSplitPointActualValue | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifPART
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifPART$new()
marshal()
Marshal the learner's model.
LearnerClassifPART$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifPART$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifPART$clone(deep = FALSE)
deepWhether to make a deep clone.
henrifnk
Frank, Eibe, Witten, H I (1998). “Generating accurate rule sets without global optimization.”
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.PART") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.PART") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Penalized (L1 and L2) Logistic Regression.
Calls penalized::penalized() from: penalized.
The penalized and unpenalized arguments in the learner are implemented slightly
differently than in penalized::penalized(). Here, there is no parameter for penalized but
instead it is assumed that every variable is penalized unless stated in the unpenalized
parameter.
trace is set to "FALSE" to disable printing output during model training.
This Learner can be instantiated via lrn():
lrn("classif.penalized")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| epsilon | numeric | 1e-10 | |
|
| fusedl | logical | FALSE | TRUE, FALSE | - |
| lambda1 | numeric | 0 | |
|
| lambda2 | numeric | 0 | |
|
| maxiter | integer | - | |
|
| positive | untyped | FALSE | - | |
| standardize | logical | FALSE | TRUE, FALSE | - |
| startbeta | untyped | - | - | |
| startgamma | untyped | - | - | |
| steps | untyped | 1L | - | |
| trace | logical | TRUE | TRUE, FALSE | - |
| unpenalized | untyped | - | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifPenalized
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifPenalized$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifPenalized$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Goeman, J J (2010). “L1 penalized estimation in the Cox proportional hazards model.” Biometrical journal, 52(1), 70–84.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.penalized") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.penalized") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Partial Least Squares Discriminant Analysis for classification.
Calls caret::plsda() from caret.
This Learner can be instantiated via lrn():
lrn("classif.plsdaCaret")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, caret, pls
| Id | Type | Default | Levels | Range |
| ncomp | integer | 2 | |
|
| prior | untyped | "softmax" | - | |
| probMethod | character | softmax | softmax, Bayes | - |
| method | character | kernelpls | kernelpls, widekernelpls, simpls, oscorespls | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifPlsdaCaret
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifPlsdaCaret$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifPlsdaCaret$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Kuhn, Max (2008). “Building Predictive Models in R Using the caret Package.” Journal of Statistical Software, 28(5), 1–26. doi:10.18637/jss.v028.i05.
Mevik, Bjorn-Helge, Wehrens, Ron (2007). “The pls Package: Principal Component and Partial Least Squares Regression in R.” Journal of Statistical Software, 18(2), 1–24. doi:10.18637/jss.v018.i02.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.plsdaCaret") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.plsdaCaret") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Polynomial GLM.
Calls polyreg::polyFit() from polyreg.
deg: We have set this to 2, pretty arbitrarily.
noisy: We have set this to FALSE, to get no output on the console.
This Learner can be instantiated via lrn():
lrn("classif.polyFit")
Task type: “classif”
Predict Types: “response”
Feature Types: “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, polyreg
| Id | Type | Default | Levels | Range |
| deg | integer | - | |
|
| maxInteractDeg | integer | - | |
|
| return_xy | logical | FALSE | TRUE, FALSE | - |
| returnPoly | logical | FALSE | TRUE, FALSE | - |
| noisy | logical | TRUE | TRUE, FALSE | - |
| glmMethod | character | one | one, all | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifPolyFit
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifPolyFit$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifPolyFit$clone(deep = FALSE)
deepWhether to make a deep clone.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Patient outcome prediction based on multi-omics data taking practitioners’ preferences into account.
Calls prioritylasso::prioritylasso() from prioritylasso.
family is set to "binomial" and cannot be changed
This Learner can be instantiated via lrn():
lrn("classif.priority_lasso")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, prioritylasso
| Id | Type | Default | Levels | Range |
| blocks | untyped | - | - | |
| type.measure | character | - | class, auc | - |
| max.coef | untyped | NULL | - | |
| block1.penalization | logical | TRUE | TRUE, FALSE | - |
| lambda.type | character | lambda.min | lambda.min, lambda.1se | - |
| standardize | logical | TRUE | TRUE, FALSE | - |
| nfolds | integer | 5 | |
|
| foldid | untyped | NULL | - | |
| cvoffset | logical | FALSE | TRUE, FALSE | - |
| cvoffsetnfolds | integer | 10 | |
|
| return.x | logical | TRUE | TRUE, FALSE | - |
| handle.missingtestdata | character | - | none, omit.prediction, set.zero, impute.block | - |
| include.allintercepts | logical | FALSE | TRUE, FALSE | - |
| use.blocks | untyped | "all" | - | |
| alignment | character | lambda | lambda, fraction | - |
| alpha | numeric | 1 | |
|
| big | numeric | 9.9e+35 | |
|
| devmax | numeric | 0.999 | |
|
| dfmax | integer | - | |
|
| eps | numeric | 1e-06 | |
|
| epsnr | numeric | 1e-08 | |
|
| exclude | untyped | - | - | |
| exmx | numeric | 250 | |
|
| fdev | numeric | 1e-05 | |
|
| gamma | untyped | - | - | |
| grouped | logical | TRUE | TRUE, FALSE | - |
| intercept | logical | TRUE | TRUE, FALSE | - |
| keep | logical | FALSE | TRUE, FALSE | - |
| lambda | untyped | - | - | |
| lambda.min.ratio | numeric | - | |
|
| lower.limits | untyped | -Inf | - | |
| maxit | integer | 100000 | |
|
| mnlam | integer | 5 | |
|
| mxit | integer | 100 | |
|
| mxitnr | integer | 25 | |
|
| nlambda | integer | 100 | |
|
| offset | untyped | NULL | - | |
| parallel | logical | FALSE | TRUE, FALSE | - |
| penalty.factor | untyped | - | - | |
| pmax | integer | - | |
|
| pmin | numeric | 1e-09 | |
|
| prec | numeric | 1e-10 | |
|
| predict.gamma | numeric | gamma.1se | |
|
| relax | logical | FALSE | TRUE, FALSE | - |
| s | numeric | lambda.1se | |
|
| standardize.response | logical | FALSE | TRUE, FALSE | - |
| thresh | numeric | 1e-07 | |
|
| trace.it | integer | 0 | |
|
| type.gaussian | character | - | covariance, naive | - |
| type.logistic | character | Newton | Newton, modified.Newton | - |
| type.multinomial | character | ungrouped | ungrouped, grouped | - |
| upper.limits | untyped | Inf | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifPriorityLasso
new()
Creates a new instance of this R6 class.
LearnerClassifPriorityLasso$new()
selected_features()
Selected features, i.e. those where the coefficient is non-zero.
LearnerClassifPriorityLasso$selected_features()
character().
clone()
The objects of this class are cloneable with this method.
LearnerClassifPriorityLasso$clone(deep = FALSE)
deepWhether to make a deep clone.
HarutyunyanLiana
Simon K, Vindi J, Roman H, Tobias H, Anne-Laure B (2018). “Priority-Lasso: a simple hierarchical approach to the prediction of clinical outcome using multi-omics data.” BMC Bioinformatics, 19. doi:10.1186/s12859-018-2344-6.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner and set parameter values learner = lrn("classif.priority_lasso", type.measure = "auc", blocks = list(bp1 = 1:4, bp2 = 5:9, bp3 = 10:28, bp4 = 29:1028)) print(learner) # Define a Task task = mlr3::as_task_classif(prioritylasso::pl_data, target = "pl_out") # Train the learner learner$train(task) # print the model print(learner$model)# Define the Learner and set parameter values learner = lrn("classif.priority_lasso", type.measure = "auc", blocks = list(bp1 = 1:4, bp2 = 5:9, bp3 = 10:28, bp4 = 29:1028)) print(learner) # Define a Task task = mlr3::as_task_classif(prioritylasso::pl_data, target = "pl_out") # Train the learner learner$train(task) # print the model print(learner$model)
Class for constructing a random forest.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
store_out_of_bag_predictions:
original id: store-out-of-bag-predictions
output_out_of_bag_complexity_statistics:
original id: output-out-of-bag-complexity-statistics
num_slots:
original id: num-slots
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
attribute-importance removed:
Compute and output attribute importance (mean impurity decrease method)
Reason for change: The parameter is removed because it's unclear how to actually use it.
This Learner can be instantiated via lrn():
lrn("classif.random_forest_weka")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| P | numeric | 100 | |
|
| O | logical | FALSE | TRUE, FALSE | - |
| store_out_of_bag_predictions | logical | FALSE | TRUE, FALSE | - |
| output_out_of_bag_complexity_statistics | logical | FALSE | TRUE, FALSE | - |
| logical | FALSE | TRUE, FALSE | - | |
| I | integer | 100 | |
|
| num_slots | integer | 1 | |
|
| K | integer | 0 | |
|
| M | integer | 1 | |
|
| V | numeric | 0.001 | |
|
| S | integer | 1 | |
|
| depth | integer | 0 | |
|
| N | integer | 0 | |
|
| U | logical | FALSE | TRUE, FALSE | - |
| B | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifRandomForestWeka
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifRandomForestWeka$new()
marshal()
Marshal the learner's model.
LearnerClassifRandomForestWeka$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifRandomForestWeka$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifRandomForestWeka$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Breiman, Leo (2001). “Random Forests.” Machine Learning, 45(1), 5–32. ISSN 1573-0565, doi:10.1023/A:1010933404324.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.random_forest_weka") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.random_forest_weka") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Tree that considers K randomly chosen attributes at each node.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("classif.random_tree")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| K | integer | 0 | |
|
| M | integer | 1 | |
|
| V | numeric | 0.001 | |
|
| S | integer | 1 | |
|
| depth | integer | 0 | |
|
| N | integer | 0 | |
|
| U | logical | FALSE | TRUE, FALSE | - |
| B | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifRandomTree
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifRandomTree$new()
marshal()
Marshal the learner's model.
LearnerClassifRandomTree$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifRandomTree$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifRandomTree$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.random_tree") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.random_tree") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Random forest for classification.
Calls randomForest::randomForest() from randomForest.
This Learner can be instantiated via lrn():
lrn("classif.randomForest")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, randomForest
| Id | Type | Default | Levels | Range |
| ntree | integer | 500 | |
|
| mtry | integer | - | |
|
| replace | logical | TRUE | TRUE, FALSE | - |
| classwt | untyped | NULL | - | |
| cutoff | untyped | - | - | |
| strata | untyped | - | - | |
| sampsize | untyped | - | - | |
| nodesize | integer | 1 | |
|
| maxnodes | integer | - | |
|
| importance | character | FALSE | accuracy, gini, none | - |
| localImp | logical | FALSE | TRUE, FALSE | - |
| proximity | logical | FALSE | TRUE, FALSE | - |
| oob.prox | logical | - | TRUE, FALSE | - |
| norm.votes | logical | TRUE | TRUE, FALSE | - |
| do.trace | logical | FALSE | TRUE, FALSE | - |
| keep.forest | logical | TRUE | TRUE, FALSE | - |
| keep.inbag | logical | FALSE | TRUE, FALSE | - |
| predict.all | logical | FALSE | TRUE, FALSE | - |
| nodes | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifRandomForest
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifRandomForest$new()
importance()
The importance scores are extracted from the slot importance.
Parameter 'importance' must be set to either "accuracy" or "gini".
LearnerClassifRandomForest$importance()
Named numeric().
oob_error()
OOB errors are extracted from the model slot err.rate.
LearnerClassifRandomForest$oob_error()
numeric(1).
clone()
The objects of this class are cloneable with this method.
LearnerClassifRandomForest$clone(deep = FALSE)
deepWhether to make a deep clone.
pat-s
Breiman, Leo (2001). “Random Forests.” Machine Learning, 45(1), 5–32. ISSN 1573-0565, doi:10.1023/A:1010933404324.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.randomForest", importance = "accuracy") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.randomForest", importance = "accuracy") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Regularized Discriminant Analysis.
Calls klaR::rda() from: klaR.
This Learner can be instantiated via lrn():
lrn("classif.rda")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| lambda | numeric | - | |
|
| gamma | numeric | - | |
|
| crossval | logical | TRUE | TRUE, FALSE | - |
| fold | integer | 10 | |
|
| train.fraction | numeric | 0.5 | |
|
| output | logical | FALSE | TRUE, FALSE | - |
| schedule | integer | 2 | |
|
| T.start | numeric | 0.1 | |
|
| halflife | numeric | 50 | |
|
| zero.temp | numeric | 0.01 | |
|
| alpha | numeric | 2 | |
|
| K | integer | 100 | |
|
| trafo | logical | TRUE | TRUE, FALSE | - |
| simAnn | logical | FALSE | TRUE, FALSE | - |
| estimate.error | logical | TRUE | TRUE, FALSE | - |
| max.iter | integer | 100 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifRda
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifRda$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifRda$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Friedman JH (1989). “Regularized Discriminant Analysis.” Journal of the American Statistical Association, 84(405), 165–175. ISSN 01621459, 1537274X, http://www.jstor.org/stable/2289860.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.rda") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.rda") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Fast decision tree learner.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("classif.reptree")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| M | integer | 2 | |
|
| V | numeric | 0.001 | |
|
| N | integer | 3 | |
|
| S | integer | 1 | |
|
| P | logical | - | TRUE, FALSE | - |
| L | integer | -1 | |
|
| I | integer | 0 | |
|
| R | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifREPTree
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifREPTree$new()
marshal()
Marshal the learner's model.
LearnerClassifREPTree$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifREPTree$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifREPTree$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.reptree") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.reptree") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Ensemble machine learning algorithm based on Random Ferns, which are a simplified,
faster alternative to Random Forests.
Calls rFerns::rFerns() from rFerns.
importance:
Actual default: FALSE
Initial value: "simple"
Reason for change: The default value of FALSE will resolve to "none", which
turns importance calculation off. To enable importance calculation by default,
importance is set to "simple".
This Learner can be instantiated via lrn():
lrn("classif.rFerns")
Task type: “classif”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, rFerns
| Id | Type | Default | Levels | Range |
| consistentSeed | untyped | NULL | - | |
| depth | integer | 5 | |
|
| ferns | integer | 1000 | |
|
| importance | untyped | FALSE | - | |
| saveForest | logical | TRUE | TRUE, FALSE | - |
| threads | integer | 0 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifRferns
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifRferns$new()
importance()
The importance scores are extracted from the model slot importance.
LearnerClassifRferns$importance()
Named numeric().
oob_error()
OOB error is extracted from the model slot oobErr.
LearnerClassifRferns$oob_error()
numeric(1).
clone()
The objects of this class are cloneable with this method.
LearnerClassifRferns$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Kursa MB (2014). “rFerns: An Implementation of the Random Ferns Method for General-Purpose Machine Learning.” Journal of Statistical Software, 61(10), 1–13. https://www.jstatsoft.org/v61/i10/.
Ozuysal, Mustafa, Calonder, Michael, Lepetit, Vincent, Fua, Pascal (2010). “Fast Keypoint Recognition Using Random Ferns.” IEEE Transactions on Pattern Analysis and Machine Intelligence, 32(3), 448-461. doi:10.1109/TPAMI.2009.23.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.rFerns") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.rFerns") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Random forest for classification.
Calls randomForestSRC::rfsrc() from randomForestSRC.
This Learner can be instantiated via lrn():
lrn("classif.rfsrc")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, randomForestSRC
| Id | Type | Default | Levels | Range |
| ntree | integer | 500 | |
|
| mtry | integer | - | |
|
| mtry.ratio | numeric | - | |
|
| nodesize | integer | 15 | |
|
| nodedepth | integer | - | |
|
| splitrule | character | gini | gini, auc, entropy | - |
| nsplit | integer | 10 | |
|
| importance | character | FALSE | FALSE, TRUE, none, permute, random, anti | - |
| block.size | integer | 10 | |
|
| bootstrap | character | by.root | by.root, by.node, none, by.user | - |
| samptype | character | swor | swor, swr | - |
| samp | untyped | - | - | |
| membership | logical | FALSE | TRUE, FALSE | - |
| sampsize | untyped | - | - | |
| sampsize.ratio | numeric | - | |
|
| na.action | character | na.omit | na.omit, na.impute | - |
| nimpute | integer | 1 | |
|
| proximity | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| distance | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| forest.wt | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| xvar.wt | untyped | - | - | |
| split.wt | untyped | - | - | |
| forest | logical | TRUE | TRUE, FALSE | - |
| var.used | character | FALSE | FALSE, all.trees | - |
| split.depth | character | FALSE | FALSE, all.trees, by.tree | - |
| seed | integer | - | |
|
| do.trace | logical | FALSE | TRUE, FALSE | - |
| get.tree | untyped | - | - | |
| outcome | character | train | train, test | - |
| ptn.count | integer | 0 | |
|
| cores | integer | 1 | |
|
| save.memory | logical | FALSE | TRUE, FALSE | - |
| perf.type | character | - | gmean, misclass, brier, none | - |
| case.depth | logical | FALSE | TRUE, FALSE | - |
| marginal.xvar | untyped | NULL | - |
mtry: This hyperparameter can alternatively be set via the added
hyperparameter mtry.ratio as mtry = max(ceiling(mtry.ratio * n_features), 1).
Note that mtry and mtry.ratio are mutually exclusive.
sampsize: This hyperparameter can alternatively be set via the added
hyperparameter sampsize.ratio as sampsize = max(ceiling(sampsize.ratio * n_obs), 1).
Note that sampsize and sampsize.ratio are mutually exclusive.
cores: This value is set as the option rf.cores during training and is
set to 1 by default.
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifRandomForestSRC
new()
Creates a new instance of this R6 class.
LearnerClassifRandomForestSRC$new()
importance()
The importance scores are extracted from the model slot importance, returned for
'all'.
LearnerClassifRandomForestSRC$importance()
Named numeric().
selected_features()
Selected features are extracted from the model slot var.used.
Note: Due to a known issue in randomForestSRC, enabling var.used = "all.trees"
causes prediction to fail. Therefore, this setting should be used exclusively
for feature selection purposes and not when prediction is required.
LearnerClassifRandomForestSRC$selected_features()
character().
oob_error()
OOB error extracted from the model slot err.rate.
LearnerClassifRandomForestSRC$oob_error()
numeric().
clone()
The objects of this class are cloneable with this method.
LearnerClassifRandomForestSRC$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Breiman, Leo (2001). “Random Forests.” Machine Learning, 45(1), 5–32. ISSN 1573-0565, doi:10.1023/A:1010933404324.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.rfsrc", importance = "TRUE") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.rfsrc", importance = "TRUE") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Classification using Rotation Forest algorithm.
Training this learner works only for tasks with at least two features.
The task must not have utf8 feature names.
Calls rotationForest::rotationForest() from rotationForest.
This Learner can be instantiated via lrn():
lrn("classif.rotationForest")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, rotationForest
| Id | Type | Default | Range |
| K | integer | 3 | |
| L | integer | 10 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifRotationForest
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifRotationForest$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifRotationForest$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Rodriguez, J.J., Kuncheva, L.I., Alonso, C.J. (2006). “Rotation Forest: A New Classifier Ensemble Method.” IEEE Transactions on Pattern Analysis and Machine Intelligence, 28(10), 1619-1630. doi:10.1109/TPAMI.2006.211.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.rotationForest") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.rotationForest") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Calls deepnet::sae.dnn.train() from deepnet.
output is set to "softmax" for probabilistic classification.
This Learner can be instantiated via lrn():
lrn("classif.saeDNN")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
| Id | Type | Default | Levels | Range |
| hidden | untyped | 10L | - | |
| activationfun | character | sigm | sigm, linear, tanh | - |
| learningrate | numeric | 0.8 | |
|
| momentum | numeric | 0.5 | |
|
| learningrate_scale | numeric | 1 | |
|
| numepochs | integer | 3 | |
|
| batchsize | integer | 100 | |
|
| output | character | - | sigm, linear, softmax | - |
| sae_output | character | linear | sigm, linear, softmax | - |
| hidden_dropout | numeric | 0 | |
|
| visible_dropout | numeric | 0 |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifSaeDNN
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifSaeDNN$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifSaeDNN$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Rong, Xiao (2022). “deepnet: Deep Learning Toolkit in R.” R package version 0.2.1. doi:10.32614/CRAN.package.deepnet, https://CRAN.R-project.org/package=deepnet.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.saeDNN") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.saeDNN") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Shrinkage Discriminant Analysis for classification.
Calls sda::sda() from sda.
This Learner can be instantiated via lrn():
lrn("classif.sda")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
| Id | Type | Default | Levels | Range |
| lambda | numeric | - | |
|
| lambda.var | numeric | - | |
|
| lambda.freqs | numeric | - | |
|
| diagonal | logical | FALSE | TRUE, FALSE | - |
| verbose | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifSda
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifSda$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifSda$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Ahdesmaeki, Miika, Strimmer, Korbinian (2010). “Feature selection in omics prediction problems using cat scores and false nondiscovery rate control.” The Annals of Applied Statistics, 4(1). ISSN 1932-6157, doi:10.1214/09-aoas277, http://dx.doi.org/10.1214/09-AOAS277.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.sda") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.sda") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Shrinkage-based Diagonal Linear Discriminant Analysis classifier.
Type of Naive Bayes classifiers that improves the estimation of the pooled variances by
using a shrinkage-based estimator of the pooled covariance matrix.
Calls sparsediscrim::lda_shrink_cov() sparsediscrim.
This Learner can be instantiated via lrn():
lrn("classif.sdlda")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, sparsediscrim
| Id | Type | Default | Range |
| num_alphas | integer | 101 | |
| prior | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifSdlda
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifSdlda$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifSdlda$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Pang H, Tong T, Zhao H (2009). “Shrinkage-Based Diagonal Discriminant Analysis and Its Applications in High-Dimensional Data.” Biometrics, 65(4), 1021–1029. ISSN 0006341X, 15410420, http://www.jstor.org/stable/20640622.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.sdlda") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.sdlda") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Stochastic Gradient Descent for learning various linear models.
Calls RWeka::make_Weka_classifier() from RWeka.
F:
Has only 2 out of 5 original loss functions: 0 = hinge loss (SVM) and 1 = log loss (logistic regression) with 0 (hinge loss) still being the default
Reason for change: this learner should only contain loss functions appropriate for classification tasks
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("classif.sgd")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| F | character | 0 | 0, 1 | - |
| L | numeric | 0.01 | |
|
| R | numeric | 1e-04 | |
|
| E | integer | 500 | |
|
| C | numeric | 0.001 | |
|
| N | logical | - | TRUE, FALSE | - |
| M | logical | - | TRUE, FALSE | - |
| S | integer | 1 | |
|
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifSGD
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifSGD$new()
marshal()
Marshal the learner's model.
LearnerClassifSGD$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifSGD$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifSGD$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.sgd") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.sgd") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
LogitBoost with simple regression functions as base learners.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("classif.simple_logistic")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| I | integer | - | |
|
| S | logical | FALSE | TRUE, FALSE | - |
| P | logical | FALSE | TRUE, FALSE | - |
| M | integer | - | |
|
| H | integer | 50 | |
|
| W | numeric | 0 | |
|
| A | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifSimpleLogistic
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifSimpleLogistic$new()
marshal()
Marshal the learner's model.
LearnerClassifSimpleLogistic$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifSimpleLogistic$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifSimpleLogistic$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Landwehr, Niels, Hall, Mark, Frank, Eibe (2005). “Logistic model trees.” Machine learning, 59(1), 161–205.
Sumner M, Frank E, Hall M (2005). “Speeding up Logistic Model Tree Induction.” In 9th European Conference on Principles and Practice of Knowledge Discovery in Databases, 675-683.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.simple_logistic") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.simple_logistic") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Support Vector classifier trained with John Platt's sequential minimal optimization algorithm.
Calls RWeka::SMO() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
E_poly:
original id: E
L_poly:
original id: L
C_poly:
original id: C
C_logistic:
original id: C
R_logistic:
original id: R
M_logistic:
original id: M
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("classif.smo")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| no_checks | logical | FALSE | TRUE, FALSE | - |
| C | numeric | 1 | |
|
| N | character | 0 | 0, 1, 2 | - |
| L | numeric | 0.001 | |
|
| P | numeric | 1e-12 | |
|
| M | logical | FALSE | TRUE, FALSE | - |
| V | integer | -1 | |
|
| W | integer | 1 | |
|
| K | character | PolyKernel | NormalizedPolyKernel, PolyKernel, Puk, RBFKernel, StringKernel | - |
| calibrator | untyped | "weka.classifiers.functions.Logistic" | - | |
| E_poly | numeric | 1 | |
|
| L_poly | logical | FALSE | TRUE, FALSE | - |
| C_poly | integer | 25007 | |
|
| C_logistic | logical | FALSE | TRUE, FALSE | - |
| R_logistic | numeric | - | |
|
| M_logistic | integer | -1 | |
|
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifSMO
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifSMO$new()
marshal()
Marshal the learner's model.
LearnerClassifSMO$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifSMO$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifSMO$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Platt J (1998). “Fast Training of Support Vector Machines using Sequential Minimal Optimization.” In Schoelkopf B, Burges C, Smola A (eds.), Advances in Kernel Methods - Support Vector Learning. MIT Press. http://research.microsoft.com/jplatt/smo.html.
Keerthi S, Shevade S, Bhattacharyya C, Murthy K (2001). “Improvements to Platt's SMO Algorithm for SVM Classifier Design.” Neural Computation, 13(3), 637-649.
Hastie T, Tibshirani R (1998). “Classification by Pairwise Coupling.” In Jordan MI, Kearns MJ, Solla SA (eds.), Advances in Neural Information Processing Systems, volume 10.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.smo") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.smo") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Sparse Linear Discriminant Analysis for classification.
Calls sparseLDA::sda() from sparseLDA.
Q is set internally to min(n_features, n_classes - 1) when not supplied.
stop is not exposed because it depends on the task.
This Learner can be instantiated via lrn():
lrn("classif.sparseLDA")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, sparseLDA, MASS, elasticnet
| Id | Type | Default | Levels | Range |
| lambda | numeric | 1e-06 | |
|
| maxIte | integer | 100 | |
|
| tol | numeric | 1e-06 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifSparseLDA
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifSparseLDA$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifSparseLDA$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Clemmensen, Line, Hastie, Trevor, Witten, Daniela, Ersboll, Bjarne (2011). “Sparse discriminant analysis.” Journal of the American Statistical Association, 106(496), 1519–1531. doi:10.1198/jasa.2011.tm09728.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.sparseLDA") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.sparseLDA") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Logistic regression with a quadratic penalization on the coefficient.
Calls stepPlr::plr() from stepPlr.
This Learner can be instantiated via lrn():
lrn("classif.stepPlr")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”
| Id | Type | Default | Levels | Range |
| cp | character | aic | aic, bic | - |
| lambda | numeric | 1e-04 | |
|
| offset.coefficients | untyped | - | - | |
| offset.subset | untyped | - | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifStepPlr
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifStepPlr$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifStepPlr$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Park, Young M, Hastie, Trevor (2007). “Penalized logistic regression for detecting gene interactions.” Biostatistics, 9(1), 30-50. ISSN 1465-4644, doi:10.1093/biostatistics/kxm010, https://doi.org/10.1093/biostatistics/kxm010.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.stepPlr") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.stepPlr") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Foundation model for tabular data.
Uses reticulate to interface with the tabpfn Python package.
This learner relies on reticulate to handle Python dependencies.
It is not necessary to install any Python package manually in advance or specify a Python environment
via reticulate::use_python(), reticulate::use_virtualenv(), reticulate::use_condaenv(),
or reticulate::use_miniconda().
By calling $train() or $predict(), the required Python packages (tapfn, torch, etc.) will be installed
automatically, if not already.
Reticulate will then configure and initialize an ephemeral environment satisfying those requirements,
unless an existing environment (e.g., "r-reticulate") in reticulate's
Order of Discovery
contains all the necessary packages.
You may also manually install tabpfn into a Python environment following the
official installation guide
and specify the environment via reticulate::use_*() before calling $train() or $predict().
Note that the GPU version of PyTorch cannot be loaded by reticulate::use_condaenv() from a conda environment.
To use a conda environment, please install the CPU version of PyTorch.
In order to save a LearnerClassifTabPFN for later usage,
it is necessary to call the $marshal() method on the Learner
before writing it to disk, as the object will otherwise not be saved correctly.
After loading a marshaled LearnerClassifTabPFN into R again,
you then need to call $unmarshal() to transform it into a useable state.
n_jobs is initialized to 1 to avoid threading conflicts with future.
categorical_feature_indices uses R indexing instead of zero-based Python indexing.
device must be a string.
If set to "auto", the behavior is the same as original.
Otherwise, the string is passed as argument to torch.device() to create a device.
inference_precision must be "auto", "autocast",
or a torch.dtype string,
e.g., "torch.float32", "torch.float64", etc.
Non-float dtypes are not supported.
inference_config is currently not supported.
random_state accepts either an integer or the special value "None"
which corresponds to None in Python.
Following the original Python implementation, the default random_state is 0.
This Learner can be instantiated via lrn():
lrn("classif.tabpfn")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, reticulate
| Id | Type | Default | Levels | Range |
| n_estimators | integer | 4 | |
|
| categorical_features_indices | untyped | - | - | |
| softmax_temperature | numeric | 0.9 | |
|
| balance_probabilities | logical | FALSE | TRUE, FALSE | - |
| average_before_softmax | logical | FALSE | TRUE, FALSE | - |
| model_path | untyped | "auto" | - | |
| device | untyped | "auto" | - | |
| ignore_pretraining_limits | logical | FALSE | TRUE, FALSE | - |
| inference_precision | character | auto | auto, autocast, torch.float32, torch.float, torch.float64, torch.double, torch.float16, torch.half, torch.bfloat16 | - |
| fit_mode | character | fit_preprocessors | low_memory, fit_preprocessors, fit_with_cache | - |
| memory_saving_mode | untyped | "auto" | - | |
| random_state | integer | 0 | |
|
| n_jobs | integer | - |
|
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifTabPFN
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifTabPFN$new()
marshal()
Marshal the learner's model.
LearnerClassifTabPFN$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifTabPFN$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifTabPFN$clone(deep = FALSE)
deepWhether to make a deep clone.
b-zhou
Hollmann, Noah, Müller, Samuel, Purucker, Lennart, Krishnakumar, Arjun, Körfer, Max, Hoo, Bin S, Schirrmeister, Tibor R, Hutter, Frank (2025). “Accurate predictions on small data with a tabular foundation model.” Nature. doi:10.1038/s41586-024-08328-6, https://www.nature.com/articles/s41586-024-08328-6.
Hollmann, Noah, Müller, Samuel, Eggensperger, Katharina, Hutter, Frank (2023). “TabPFN: A transformer that solves small tabular classification problems in a second.” In International Conference on Learning Representations 2023.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Voted Perceptron Algorithm by Freund and Schapire.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("classif.voted_perceptron")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| I | integer | 1 | |
|
| E | numeric | 1 | |
|
| S | integer | 1 | |
|
| M | integer | 10000 | |
|
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifVotedPerceptron
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerClassif$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerClassifVotedPerceptron$new()
marshal()
Marshal the learner's model.
LearnerClassifVotedPerceptron$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerClassifVotedPerceptron$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerClassifVotedPerceptron$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Freund Y, Schapire RE (1998). “Large margin classification using the perceptron algorithm.” In 11th Annual Conference on Computational Learning Theory, 209-217.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("classif.voted_perceptron") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("classif.voted_perceptron") print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Fits a competing risks Cox model using likelihood based boosting.
Calls CoxBoost::CoxBoost() or CoxBoost::cv.CoxBoost() from package
CoxBoost.
Predicts cumulative incidence functions (one CIF matrix per cause, rows = observations,
columns = times).
If times are not provided for prediction, the unique event times (across causes)
from the training set are used by default.
This Learner can be instantiated via lrn():
lrn("cmprsk.coxboost")
Task type: “cmprsk”
Predict Types: “cif”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3cmprsk, mlr3extralearners, CoxBoost
| Id | Type | Default | Levels | Range |
| cv | logical | - | TRUE, FALSE | - |
| maxstepno | integer | 100 | |
|
| K | integer | 10 | |
|
| type | character | verweij | verweij, naive | - |
| folds | untyped | NULL | - | |
| minstepno | integer | 50 | |
|
| start.penalty | numeric | - | |
|
| iter.max | integer | 10 | |
|
| upper.margin | numeric | 0.05 | |
|
| unpen.index | untyped | - | - | |
| standardize | logical | TRUE | TRUE, FALSE | - |
| stepno | integer | 100 | |
|
| penalty | numeric | - | |
|
| criterion | character | pscore | pscore, score, hpscore, hscore | - |
| stepsize.factor | numeric | 1 | |
|
| sf.scheme | character | sigmoid | sigmoid, linear | - |
| pendistmat | untyped | - | - | |
| connected.index | untyped | - | - | |
| x.is.01 | logical | FALSE | TRUE, FALSE | - |
| return.score | logical | TRUE | TRUE, FALSE | - |
| trace | logical | FALSE | TRUE, FALSE | - |
| cmprsk | character | - | csh, ccsh | - |
| coupled.strata | logical | TRUE | TRUE, FALSE | - |
| at.step | untyped | - | - | |
| times | untyped | - | - |
cv: If TRUE, uses cross-validation with CoxBoost::cv.CoxBoost() to
select the optimal number of boosting steps, then refits the final model using
CoxBoost::CoxBoost() with this value. Initialized to FALSE by default.
penalty: If set to "optimCoxBoostPenalty", uses CoxBoost::optimCoxBoostPenalty()
to determine the optimal penalty value and number of steps (via
CoxBoost::cv.CoxBoost()) for the final model.
cmprsk: Type of competing risks analysis. Initialized to "csh"
(cause-specific hazards) which models each cause separately, treating other
causes as censored. "ccsh" (combined cause-specific hazards) is another
option which combines information across causes for variable selection using
a joint criterion.
mlr3::Learner -> mlr3cmprsk::LearnerCompRisks -> LearnerCompRisksCoxboost
new()
Creates a new instance of this R6 class.
LearnerCompRisksCoxboost$new()
selected_features()
Returns the set of cause-specific selected features which have non-zero coefficients.
Calls the internal coef.CoxBoost() function.
LearnerCompRisksCoxboost$selected_features(at_step = NULL, cause = 1)
at_step(integer(1))
Which boosting step to get the coefficients for. If no step is given
(default), the final boosting step is used.
cause(integer(1))
Integer value indicating the event of interest.
(character()) vector of feature names.
clone()
The objects of this class are cloneable with this method.
LearnerCompRisksCoxboost$clone(deep = FALSE)
deepWhether to make a deep clone.
bblodfon
Binder, Harald, Allignol, Arthur, Schumacher, Martin, Beyersmann, Jan (2009). “Boosting for high-dimensional time-to-event data with competing risks.” Bioinformatics, 25(7), 890–896.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("cmprsk.coxboost", stepno = 10) print(learner) # Define a Task task = tsk("pbc") task$col_roles$feature = c("age", "chol", "copper", "platelet", "trig", "albumin", "alk.phos", "ast", "bili", "protime") # Stratification based on event task$set_col_roles(cols = "status", add_to = "stratum") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$selected_features(cause = 1)) # for cause = 1 print(learner$selected_features(cause = 2)) # for cause = 2 # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("cmprsk.coxboost", stepno = 10) print(learner) # Define a Task task = tsk("pbc") task$col_roles$feature = c("age", "chol", "copper", "platelet", "trig", "albumin", "alk.phos", "ast", "bili", "protime") # Stratification based on event task$set_col_roles(cols = "status", add_to = "stratum") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$selected_features(cause = 1)) # for cause = 1 print(learner$selected_features(cause = 2)) # for cause = 2 # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Random survival forests for competing risks.
Calls randomForestSRC::rfsrc() from randomForestSRC.
This Learner can be instantiated via lrn():
lrn("cmprsk.rfsrc")
Task type: “cmprsk”
Predict Types: “cif”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3cmprsk, mlr3extralearners, randomForestSRC
| Id | Type | Default | Levels | Range |
| ntree | integer | 500 | |
|
| mtry | integer | - | |
|
| mtry.ratio | numeric | - | |
|
| nodesize | integer | 15 | |
|
| nodedepth | integer | - | |
|
| splitrule | character | logrankCR | logrankCR, logrank | - |
| nsplit | integer | 10 | |
|
| importance | character | FALSE | FALSE, TRUE, none, anti, permute, random | - |
| block.size | integer | 10 | |
|
| bootstrap | character | by.root | by.root, by.node, none, by.user | - |
| samptype | character | swor | swor, swr | - |
| samp | untyped | - | - | |
| membership | logical | FALSE | TRUE, FALSE | - |
| sampsize | untyped | - | - | |
| sampsize.ratio | numeric | - | |
|
| na.action | character | na.omit | na.omit, na.impute | - |
| nimpute | integer | 1 | |
|
| ntime | integer | 150 | |
|
| cause | untyped | - | - | |
| proximity | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| distance | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| forest.wt | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| xvar.wt | untyped | - | - | |
| split.wt | untyped | - | - | |
| forest | logical | TRUE | TRUE, FALSE | - |
| var.used | character | FALSE | FALSE, all.trees | - |
| split.depth | character | FALSE | FALSE, all.trees, by.tree | - |
| seed | integer | - | |
|
| do.trace | logical | FALSE | TRUE, FALSE | - |
| get.tree | untyped | - | - | |
| outcome | character | train | train, test | - |
| ptn.count | integer | 0 | |
|
| cores | integer | 1 | |
|
| save.memory | logical | FALSE | TRUE, FALSE | - |
| use.uno | logical | TRUE | TRUE, FALSE | - |
| perf.type | character | - | none | - |
| case.depth | logical | FALSE | TRUE, FALSE | - |
| marginal.xvar | untyped | NULL | - |
ntime: Number of time points to coerce the observed event times for use
in the estimated cumulative incidence functions during prediction.
We changed the default value of 150 to 0, meaning we now use all the
unique event times from the train set across all competing causes.
mtry: This hyperparameter can alternatively be set via the added
hyperparameter mtry.ratio as mtry = max(ceiling(mtry.ratio * n_features), 1).
Note that mtry and mtry.ratio are mutually exclusive.
sampsize: This hyperparameter can alternatively be set via the added
hyperparameter sampsize.ratio as sampsize = max(ceiling(sampsize.ratio * n_obs), 1).
Note that sampsize and sampsize.ratio are mutually exclusive.
cores: This value is set as the option rf.cores during training and is
set to 1 by default.
mlr3::Learner -> mlr3cmprsk::LearnerCompRisks -> LearnerCompRisksRandomForestSRC
new()
Creates a new instance of this R6 class.
LearnerCompRisksRandomForestSRC$new()
importance()
The importance scores are extracted from the model slot importance and
are cause-specific.
LearnerCompRisksRandomForestSRC$importance(cause = 1)
causeInteger value indicating the event of interest
Named numeric().
selected_features()
Selected features are extracted from the model slot var.used.
Note: Due to a known issue in randomForestSRC, enabling var.used = "all.trees"
causes prediction to fail. Therefore, this setting should be used exclusively
for feature selection purposes and not when prediction is required.
LearnerCompRisksRandomForestSRC$selected_features()
character().
oob_error()
Extracts the out-of-bag (OOB) cumulative incidence function (CIF) error
from the model's err.rate slot.
If cause = "mean" (default), the function returns a weighted average
of the cause-specific OOB errors, where the weights correspond to the
observed proportion of events for each cause in the training data.
LearnerCompRisksRandomForestSRC$oob_error(cause = "mean")
causeInteger (event type) or "mean" (default). Use a specific
event type to retrieve its OOB error, or "mean" to compute the weighted
average across causes.
numeric().
clone()
The objects of this class are cloneable with this method.
LearnerCompRisksRandomForestSRC$clone(deep = FALSE)
deepWhether to make a deep clone.
bblodfon
Ishwaran, H., Gerds, A. T, Kogalur, B. U, Moore, D. R, Gange, J. S, Lau, M. B (2014). “Random survival forests for competing risks.” Biostatistics, 15(4), 757–773. doi:10.1093/BIOSTATISTICS/KXU010, https://doi.org/10.1093/BIOSTATISTICS/KXU010.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("cmprsk.rfsrc", importance = "TRUE") print(learner) # Define a Task task = tsk("pbc") # Stratification based on event task$set_col_roles(cols = "status", add_to = "stratum") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance(cause = 1)) # VIMP for cause = 1 print(learner$importance(cause = 2)) # VIMP for cause = 2 print(learner$oob_error()) # weighted-mean across causes # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("cmprsk.rfsrc", importance = "TRUE") print(learner) # Define a Task task = tsk("pbc") # Stratification based on event task$set_col_roles(cols = "status", add_to = "stratum") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance(cause = 1)) # VIMP for cause = 1 print(learner$importance(cause = 2)) # VIMP for cause = 2 print(learner$oob_error()) # weighted-mean across causes # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Adaptive best-subset selection for regression.
Calls abess::abess() from abess.
This Learner can be instantiated via lrn():
lrn("regr.abess")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”
| Id | Type | Default | Levels | Range |
| family | character | gaussian | gaussian, mgaussian, poisson, gamma | - |
| tune.path | character | sequence | sequence, gsection | - |
| tune.type | character | gic | gic, aic, bic, ebic, cv | - |
| normalize | integer | NULL | |
|
| support.size | untyped | NULL | - | |
| c.max | integer | 2 | |
|
| gs.range | untyped | NULL | - | |
| lambda | numeric | 0 | |
|
| always.include | untyped | NULL | - | |
| group.index | untyped | NULL | - | |
| init.active.set | untyped | NULL | - | |
| splicing.type | integer | 2 | |
|
| max.splicing.iter | integer | 20 | |
|
| screening.num | integer | NULL | |
|
| important.search | integer | NULL | |
|
| warm.start | logical | TRUE | TRUE, FALSE | - |
| nfolds | integer | 5 | |
|
| foldid | untyped | NULL | - | |
| cov.update | logical | FALSE | TRUE, FALSE | - |
| newton | character | exact | exact, approx | - |
| newton.thresh | numeric | 1e-06 | |
|
| max.newton.iter | integer | NULL | |
|
| early.stop | logical | FALSE | TRUE, FALSE | - |
| ic.scale | numeric | 1 | |
|
| num.threads | integer | 0 | |
|
| seed | integer | 1 |
|
num.threads: This parameter is initialized to 1 (default is 0) to avoid conflicts with the mlr3 parallelization.
family: Depends on the task type, if the parameter family is NULL, it is set to "binomial" for binary
classification tasks and to "multinomial" for multiclass classification problems.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrAbess
new()
Creates a new instance of this R6 class.
LearnerRegrAbess$new()
selected_features()
Extract the name of selected features from the model by abess::extract().
LearnerRegrAbess$selected_features()
The names of selected features
clone()
The objects of this class are cloneable with this method.
LearnerRegrAbess$clone(deep = FALSE)
deepWhether to make a deep clone.
bbayukari
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.abess") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.abess") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Accelerated oblique random regression forest.
Calls aorsf::orsf() from aorsf.
Note that although the learner has the property "missing" and it can in
principle deal with missing values, the behaviour has to be configured using
the parameter na_action.
n_thread: This parameter is initialized to 1 (default is 0) to avoid conflicts with the mlr3 parallelization.
pred_simplify has to be TRUE, otherwise response is NA in prediction
This Learner can be instantiated via lrn():
lrn("regr.aorsf")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, aorsf
| Id | Type | Default | Levels | Range |
| attach_data | logical | TRUE | TRUE, FALSE | - |
| epsilon | numeric | 1e-09 | |
|
| importance | character | anova | none, anova, negate, permute | - |
| importance_max_pvalue | numeric | 0.01 | |
|
| leaf_min_events | integer | 1 | |
|
| leaf_min_obs | integer | 5 | |
|
| max_iter | integer | 20 | |
|
| method | character | glm | glm, net, pca, random | - |
| mtry | integer | NULL | |
|
| mtry_ratio | numeric | - | |
|
| n_retry | integer | 3 | |
|
| n_split | integer | 5 | |
|
| n_thread | integer | - | |
|
| n_tree | integer | 500 | |
|
| na_action | character | fail | fail, impute_meanmode | - |
| net_mix | numeric | 0.5 | |
|
| oobag | logical | FALSE | TRUE, FALSE | - |
| oobag_eval_every | integer | NULL | |
|
| oobag_fun | untyped | NULL | - | |
| oobag_pred_type | character | mean | none, leaf, mean | - |
| pred_aggregate | logical | TRUE | TRUE, FALSE | - |
| sample_fraction | numeric | 0.632 | |
|
| sample_with_replacement | logical | TRUE | TRUE, FALSE | - |
| scale_x | logical | FALSE | TRUE, FALSE | - |
| split_min_events | integer | 5 | |
|
| split_min_obs | integer | 10 | |
|
| split_min_stat | numeric | NULL | |
|
| split_rule | character | variance | variance | - |
| target_df | integer | NULL | |
|
| tree_seeds | integer | NULL | |
|
| verbose_progress | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrObliqueRandomForest
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrObliqueRandomForest$new()
oob_error()
OOB concordance error extracted from the model slot
eval_oobag$stat_values
LearnerRegrObliqueRandomForest$oob_error()
numeric().
importance()
The importance scores are extracted from the model.
LearnerRegrObliqueRandomForest$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerRegrObliqueRandomForest$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.aorsf") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.aorsf") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bayesian Additive Regression Trees are similar to gradient boosting algorithms.
Calls dbarts::bart() from dbarts.
This Learner can be instantiated via lrn():
lrn("regr.bart")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, dbarts
| Id | Type | Default | Levels | Range |
| ntree | integer | 200 | |
|
| sigest | untyped | NULL | - | |
| sigdf | integer | 3 | |
|
| sigquant | numeric | 0.9 | |
|
| k | numeric | 2 | |
|
| power | numeric | 2 | |
|
| base | numeric | 0.95 | |
|
| ndpost | integer | 1000 | |
|
| nskip | integer | 100 | |
|
| printevery | integer | 100 | |
|
| keepevery | integer | 1 | |
|
| keeptrainfits | logical | TRUE | TRUE, FALSE | - |
| usequants | logical | FALSE | TRUE, FALSE | - |
| numcut | integer | 100 | |
|
| printcutoffs | integer | 0 | |
|
| verbose | logical | FALSE | TRUE, FALSE | - |
| nthread | integer | 1 | |
|
| keeptrees | logical | FALSE | TRUE, FALSE | - |
| keepcall | logical | TRUE | TRUE, FALSE | - |
| sampleronly | logical | FALSE | TRUE, FALSE | - |
| seed | integer | NA | |
|
| proposalprobs | untyped | NULL | - | |
| splitprobs | untyped | NULL | - | |
| keepsampler | logical | - | TRUE, FALSE | - |
| n.threads | integer | - |
|
Parameter: offset
The parameter is removed, because only dbarts::bart2 allows an offset during training,
and therefore the offset parameter in dbarts:::predict.bart is irrelevant for
dbarts::dbart.
Parameter: nchain, combineChains, combinechains
The parameters are removed as parallelization of multiple models is handled by future.
keeptrees is initialized to TRUE because it is required for prediction.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBart
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBart$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrBart$clone(deep = FALSE)
deepWhether to make a deep clone.
ck37
Sparapani, Rodney, Spanbauer, Charles, McCulloch, Robert (2021). “Nonparametric machine learning and efficient computation with bayesian additive regression trees: the BART R package.” Journal of Statistical Software, 97, 1–66.
Chipman, A H, George, I E, McCulloch, E R (2010). “BART: Bayesian additive regression trees.” The Annals of Applied Statistics, 4(1), 266–298.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.bart") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.bart") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bayesian CART regression model.
Calls tgp::bcart() from tgp.
For the predicted mean ZZ.km and for the predicted variance ZZ.ks2 are chosen.
Factor features are one-hot encoded with reference encoding before fitting, matching the
behavior of the original mlr learner. If factors are present, basemax is set to the number
of non-factor features so that tree proposals account for the numeric part of the design.
verb is initialized to 0 to silence printing.
pred.n is initialized to FALSE to skip prediction during training.
This Learner can be instantiated via lrn():
lrn("regr.bcart")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, tgp
| Id | Type | Default | Levels | Range |
| bprior | character | bflat | b0, b0not, bflat, bmle, bmznot, bmzt | - |
| Ds2x | logical | FALSE | TRUE, FALSE | - |
| improv | logical | FALSE | TRUE, FALSE | - |
| itemps | untyped | NULL | - | |
| krige | logical | TRUE | TRUE, FALSE | - |
| m0r1 | logical | TRUE | TRUE, FALSE | - |
| pred.n | logical | - | TRUE, FALSE | - |
| R | integer | 1 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| verb | integer | - | |
|
| zcov | logical | FALSE | TRUE, FALSE | - |
| tree | untyped | c(0.5, 2) | - | |
| BTE | untyped | c(2000L, 7000L, 2L) | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBcart
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBcart$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrBcart$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Gramacy RB (2007). “tgp: An R Package for Bayesian Nonstationary, Semiparametric Nonlinear Regression and Design by Treed Gaussian Process Models.” Journal of Statistical Software, 19(9), 1–46. doi:10.18637/jss.v019.i09.
Gramacy RB, Taddy M (2010). “Categorical Inputs, Sensitivity Analysis, Optimization and Importance Tempering with tgp Version 2, an R Package for Treed Gaussian Process Models.” Journal of Statistical Software, 33(6), 1–48. doi:10.18637/jss.v033.i06.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.bcart") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.bcart") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bayesian Gaussian process regression.
Calls tgp::bgp() from tgp.
For the predicted mean ZZ.km and for the predicted variance ZZ.ks2 are chosen.
verb is initialized to 0 to silence printing.
pred.n is initialized to FALSE to skip prediction during training.
This Learner can be instantiated via lrn():
lrn("regr.bgp")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, tgp
| Id | Type | Default | Levels | Range |
| meanfn | character | linear | constant, linear | - |
| bprior | character | bflat | b0, b0not, bflat, bmle, bmznot, bmzt | - |
| corr | character | expsep | exp, expsep, matern, sim | - |
| BTE | untyped | c(1000L, 4000L, 2L) | - | |
| R | integer | 1 | |
|
| m0r1 | logical | TRUE | TRUE, FALSE | - |
| itemps | untyped | NULL | - | |
| pred.n | logical | - | TRUE, FALSE | - |
| krige | logical | TRUE | TRUE, FALSE | - |
| zcov | logical | FALSE | TRUE, FALSE | - |
| Ds2x | logical | FALSE | TRUE, FALSE | - |
| improv | logical | FALSE | TRUE, FALSE | - |
| nu | numeric | 1.5 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| verb | integer | - | |
|
| MAP | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBgp
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBgp$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrBgp$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Gramacy RB (2007). “tgp: An R Package for Bayesian Nonstationary, Semiparametric Nonlinear Regression and Design by Treed Gaussian Process Models.” Journal of Statistical Software, 19(9), 1–46. doi:10.18637/jss.v019.i09.
Gramacy RB, Taddy M (2010). “Categorical Inputs, Sensitivity Analysis, Optimization and Importance Tempering with tgp Version 2, an R Package for Treed Gaussian Process Models.” Journal of Statistical Software, 33(6), 1–48. doi:10.18637/jss.v033.i06.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.bgp") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.bgp") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bayesian Gaussian process regression with jumps to the limiting linear model.
Calls tgp::bgpllm() from tgp.
For the predicted mean ZZ.km and for the predicted variance ZZ.ks2 are chosen.
verb is initialized to 0 to silence printing.
pred.n is initialized to FALSE to skip prediction during training.
This Learner can be instantiated via lrn():
lrn("regr.bgpllm")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, tgp
| Id | Type | Default | Levels | Range |
| meanfn | character | linear | constant, linear | - |
| bprior | character | bflat | b0, b0not, bflat, bmle, bmznot, bmzt | - |
| corr | character | expsep | exp, expsep, matern, sim | - |
| gamma | untyped | c(10, 0.2, 0.7) | - | |
| BTE | untyped | c(2000L, 4000L, 2L) | - | |
| R | integer | 1 | |
|
| m0r1 | logical | TRUE | TRUE, FALSE | - |
| itemps | untyped | NULL | - | |
| pred.n | logical | - | TRUE, FALSE | - |
| krige | logical | TRUE | TRUE, FALSE | - |
| zcov | logical | FALSE | TRUE, FALSE | - |
| Ds2x | logical | FALSE | TRUE, FALSE | - |
| improv | logical | FALSE | TRUE, FALSE | - |
| nu | numeric | 1.5 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| verb | integer | - | |
|
| MAP | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBgpllm
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBgpllm$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrBgpllm$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Gramacy RB (2007). “tgp: An R Package for Bayesian Nonstationary, Semiparametric Nonlinear Regression and Design by Treed Gaussian Process Models.” Journal of Statistical Software, 19(9), 1–46. doi:10.18637/jss.v019.i09.
Gramacy RB, Taddy M (2010). “Categorical Inputs, Sensitivity Analysis, Optimization and Importance Tempering with tgp Version 2, an R Package for Treed Gaussian Process Models.” Journal of Statistical Software, 33(6), 1–48. doi:10.18637/jss.v033.i06.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.bgpllm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.bgpllm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bayesian linear regression model.
Calls tgp::blm() from tgp.
For the predicted mean ZZ.km and for the predicted variance ZZ.ks2 are chosen.
verb is initialized to 0 to silence printing.
pred.n is initialized to FALSE to skip prediction during training.
This Learner can be instantiated via lrn():
lrn("regr.blm")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, tgp
| Id | Type | Default | Levels | Range |
| bprior | character | bflat | b0, b0not, bflat, bmle, bmznot, bmzt | - |
| Ds2x | logical | FALSE | TRUE, FALSE | - |
| improv | logical | FALSE | TRUE, FALSE | - |
| itemps | untyped | NULL | - | |
| krige | logical | TRUE | TRUE, FALSE | - |
| m0r1 | logical | TRUE | TRUE, FALSE | - |
| MAP | logical | TRUE | TRUE, FALSE | - |
| meanfn | character | linear | constant, linear | - |
| pred.n | logical | - | TRUE, FALSE | - |
| R | integer | 1 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| verb | integer | - | |
|
| zcov | logical | FALSE | TRUE, FALSE | - |
| BTE | untyped | c(1000L, 4000L, 3L) | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBlm
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBlm$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrBlm$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Gramacy RB (2007). “tgp: An R Package for Bayesian Nonstationary, Semiparametric Nonlinear Regression and Design by Treed Gaussian Process Models.” Journal of Statistical Software, 19(9), 1–46. doi:10.18637/jss.v019.i09.
Gramacy RB, Taddy M (2010). “Categorical Inputs, Sensitivity Analysis, Optimization and Importance Tempering with tgp Version 2, an R Package for Treed Gaussian Process Models.” Journal of Statistical Software, 33(6), 1–48. doi:10.18637/jss.v033.i06.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.blm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.blm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Random forests for blocks of clinical and omics covariate data.
Calls blockForest::blockfor() from package blockForest.
The training model includes only the $forest slot, excluding the paramvalues
and the biased_oob_error_donotuse.
In this learner, only the trained forest object ($forest) is retained. The
optimized block-specific tuning parameters (paramvalues) and the biased OOB
error estimate (biased_oob_error_donotuse) are discarded, as they are either
not needed for downstream use or not reliable for performance estimation.
num.threads is initialized to 1 to avoid conflicts with parallelization via future.
This Learner can be instantiated via lrn():
lrn("regr.blockforest")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, blockForest
| Id | Type | Default | Levels | Range |
| blocks | untyped | - | - | |
| block.method | character | BlockForest | BlockForest, RandomBlock, BlockVarSel, VarProb, SplitWeights | - |
| num.trees | integer | 2000 | |
|
| mtry | untyped | NULL | - | |
| nsets | integer | 300 | |
|
| num.trees.pre | integer | 1500 | |
|
| splitrule | character | extratrees | extratrees, variance, maxstat | - |
| always.select.block | integer | 0 | |
|
| importance | character | - | none, impurity, impurity_corrected, permutation | - |
| num.threads | integer | - | |
|
| seed | integer | NULL | |
|
| verbose | logical | TRUE | TRUE, FALSE | - |
| se.method | character | infjack | jack, infjack | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBlockForest
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBlockForest$new()
importance()
The importance scores are extracted from the model slot variable.importance.
LearnerRegrBlockForest$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerRegrBlockForest$clone(deep = FALSE)
deepWhether to make a deep clone.
bblodfon
Hornung, R., Wright, N. M (2019). “Block Forests: Random forests for blocks of clinical and omics covariate data.” BMC Bioinformatics, 20(1), 1–17. doi:10.1186/s12859-019-2942-y, https://doi.org/10.1186/s12859-019-2942-y.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # check task's features task$feature_names # partition features to 2 blocks blocks = list(bl1 = 1:3, bl2 = 4:10) # define learner learner = lrn("regr.blockforest", blocks = blocks, importance = "permutation", nsets = 10, num.trees = 50, num.trees.pre = 10, splitrule = "variance") # Train the learner on the training ids learner$train(task, row_ids = ids$train) # feature importance learner$importance() # Make predictions for the test observations pred = learner$predict(task, row_ids = ids$test) pred # Score the predictions pred$score()# Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # check task's features task$feature_names # partition features to 2 blocks blocks = list(bl1 = 1:3, bl2 = 4:10) # define learner learner = lrn("regr.blockforest", blocks = blocks, importance = "permutation", nsets = 10, num.trees = 50, num.trees.pre = 10, splitrule = "variance") # Train the learner on the training ids learner$train(task, row_ids = ids$train) # feature importance learner$importance() # Make predictions for the test observations pred = learner$predict(task, row_ids = ids$test) pred # Score the predictions pred$score()
Fully Bayesian Gaussian Process via botorch, using the SaasFullyBayesianSingleTaskGP model.
Unlike standard GP models that use MAP estimation for hyperparameters, this model uses MCMC (NUTS) to learn
full posterior distributions over kernel hyperparameters.
See here for more details.
Uses reticulate to interface with Python.
This Learner can be instantiated via lrn():
lrn("regr.botorch_fullybayesian")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, reticulate
| Id | Type | Default | Levels | Range |
| device | character | cpu | cpu, cuda | - |
| input_transform | character | - | normalize, standardize, log10, warp, none | - |
| outcome_transform | character | - | standardize, none | - |
| warmup_steps | integer | - | |
|
| num_samples | integer | - | |
|
| thinning | integer | - | |
|
| max_tree_depth | integer | - | |
|
| disable_progbar | logical | - | TRUE, FALSE | - |
| jit_compile | logical | - | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBotorchFullyBayesian
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBotorchFullyBayesian$new()
marshal()
Marshal the learner's model.
LearnerRegrBotorchFullyBayesian$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrBotorchFullyBayesian$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrBotorchFullyBayesian$clone(deep = FALSE)
deepWhether to make a deep clone.
Marc Becker
Gaussian Process via botorch and gpytorch, using the MixedSingleTaskGP.
See here for more details.
Uses reticulate to interface with Python.
This Learner can be instantiated via lrn():
lrn("regr.botorch_mixedsingletaskgp")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, reticulate
| Id | Type | Default | Levels |
| device | character | cpu | cpu, cuda |
| input_transform | character | - | normalize, standardize, log10, warp, none |
| outcome_transform | character | - | standardize, log, none |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBotorchMixedSingleTaskGP
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBotorchMixedSingleTaskGP$new()
marshal()
Marshal the learner's model.
LearnerRegrBotorchMixedSingleTaskGP$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrBotorchMixedSingleTaskGP$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrBotorchMixedSingleTaskGP$clone(deep = FALSE)
deepWhether to make a deep clone.
Marc Becker
Gaussian Process via botorch and gpytorch, using the SingleTaskGP model.
See here for more details.
Uses reticulate to interface with Python.
This Learner can be instantiated via lrn():
lrn("regr.botorch_singletaskgp")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, reticulate
| Id | Type | Default | Levels |
| device | character | cpu | cpu, cuda |
| kernel | character | - | matern_2.5, matern_1.5, matern_0.5, rbf, linear, polynomial, periodic, cosine, rq, piecewise_polynomial, [...] |
| input_transform | character | - | normalize, standardize, log10, warp, none |
| outcome_transform | character | - | standardize, log, none |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBotorchSingleTaskGP
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBotorchSingleTaskGP$new()
marshal()
Marshal the learner's model.
LearnerRegrBotorchSingleTaskGP$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrBotorchSingleTaskGP$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrBotorchSingleTaskGP$clone(deep = FALSE)
deepWhether to make a deep clone.
Marc Becker
Bayesian regularization for feed-forward neural networks.
Calls brnn::brnn() from brnn.
This Learner can be instantiated via lrn():
lrn("regr.brnn")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, brnn
| Id | Type | Default | Levels | Range |
| change | numeric | 0.001 | |
|
| cores | integer | 1 | |
|
| epochs | integer | 1000 | |
|
| min_grad | numeric | 1e-10 | |
|
| Monte_Carlo | logical | FALSE | TRUE, FALSE | - |
| mu | numeric | 0.005 | |
|
| mu_dec | numeric | 0.1 | |
|
| mu_inc | numeric | 10 | |
|
| mu_max | numeric | 1e+10 | |
|
| neurons | integer | 2 | |
|
| normalize | logical | TRUE | TRUE, FALSE | - |
| samples | integer | 40 | |
|
| tol | numeric | 1e-06 | |
|
| verbose | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBrnn
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBrnn$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrBrnn$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.brnn") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.brnn") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Regression gradient boosting learner.
Calls bst::bst() from bst.
Learner = "ls": Default base learner type
xval = 0: No cross-validation
maxdepth = 1: Maximum tree depth
This Learner can be instantiated via lrn():
lrn("regr.bst")
Task type: “regr”
Predict Types: “response”
Feature Types: “numeric”
Required Packages: mlr3, mlr3extralearners, bst, rpart
| Id | Type | Default | Levels | Range |
| center | logical | FALSE | TRUE, FALSE | - |
| coefir | untyped | NULL | - | |
| cost | numeric | 0.5 | |
|
| cp | numeric | 0.01 | |
|
| df | integer | 4 | |
|
| family | character | gaussian | gaussian, laplace, huber, rhuberDC, thingeDC, tbinomDC, binomdDC | - |
| f.init | untyped | NULL | - | |
| fk | untyped | NULL | - | |
| intercept | logical | TRUE | TRUE, FALSE | - |
| iter | integer | 1 | |
|
| Learner | character | ls | ls, sm, tree | - |
| maxdepth | integer | 1 | |
|
| maxsurrogate | integer | 5 | |
|
| minbucket | integer | - | |
|
| minsplit | integer | 20 | |
|
| mstop | integer | 50 | |
|
| numsample | integer | 50 | |
|
| nu | numeric | 0.1 | |
|
| q | numeric | - | |
|
| qh | numeric | - | |
|
| s | numeric | - | |
|
| sh | numeric | - | |
|
| start | logical | FALSE | TRUE, FALSE | - |
| surrogatestyle | integer | 0 | |
|
| threshold | character | adaptive | adaptive, fixed | - |
| trace | logical | FALSE | TRUE, FALSE | - |
| trun | logical | FALSE | TRUE, FALSE | - |
| twinboost | logical | FALSE | TRUE, FALSE | - |
| twintype | integer | 1 | |
|
| xselect.init | untyped | NULL | - | |
| xval | integer | 10 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBst
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBst$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrBst$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.bst") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.bst") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bayesian treed Gaussian process regression model.
Calls tgp::btgp() from tgp.
For the predicted mean ZZ.km and for the predicted variance ZZ.ks2 are chosen.
Factor features are one-hot encoded with reference encoding before fitting.
If factors are present, basemax is set to the number of non-factor features
so that tree proposals account for the numeric part of the design.
verb is initialized to 0 to silence printing.
pred.n is initialized to FALSE to skip prediction during training.
This Learner can be instantiated via lrn():
lrn("regr.btgp")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, tgp
| Id | Type | Default | Levels | Range |
| meanfn | character | linear | constant, linear | - |
| bprior | character | bflat | b0, b0not, bflat, bmle, bmznot, bmzt | - |
| corr | character | expsep | exp, expsep, matern, sim | - |
| tree | untyped | c(0.5, 2) | - | |
| BTE | untyped | c(2000L, 7000L, 2L) | - | |
| R | integer | 1 | |
|
| m0r1 | logical | TRUE | TRUE, FALSE | - |
| linburn | logical | FALSE | TRUE, FALSE | - |
| itemps | untyped | NULL | - | |
| pred.n | logical | - | TRUE, FALSE | - |
| krige | logical | TRUE | TRUE, FALSE | - |
| zcov | logical | FALSE | TRUE, FALSE | - |
| Ds2x | logical | FALSE | TRUE, FALSE | - |
| improv | logical | FALSE | TRUE, FALSE | - |
| nu | numeric | 1.5 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| verb | integer | - | |
|
| MAP | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBtgp
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBtgp$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrBtgp$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Gramacy RB (2007). “tgp: An R Package for Bayesian Nonstationary, Semiparametric Nonlinear Regression and Design by Treed Gaussian Process Models.” Journal of Statistical Software, 19(9), 1–46. doi:10.18637/jss.v019.i09.
Gramacy RB, Taddy M (2010). “Categorical Inputs, Sensitivity Analysis, Optimization and Importance Tempering with tgp Version 2, an R Package for Treed Gaussian Process Models.” Journal of Statistical Software, 33(6), 1–48. doi:10.18637/jss.v033.i06.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.btgp") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.btgp") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bayesian treed Gaussian process with jumps to the limiting linear model.
Calls tgp::btgpllm() from tgp.
For the predicted mean ZZ.km and for the predicted variance ZZ.ks2 are chosen.
Factor features are one-hot encoded with reference encoding before fitting.
If factors are present, basemax is set to the number of non-factor features so
that tree proposals account for the numeric part of the design.
verb is initialized to 0 to silence printing.
pred.n is initialized to FALSE to skip prediction during training.
This Learner can be instantiated via lrn():
lrn("regr.btgpllm")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, tgp
| Id | Type | Default | Levels | Range |
| bprior | character | bflat | b0, b0not, bflat, bmle, bmznot, bmzt | - |
| corr | character | expsep | exp, expsep, matern, sim | - |
| Ds2x | logical | FALSE | TRUE, FALSE | - |
| improv | logical | FALSE | TRUE, FALSE | - |
| itemps | untyped | NULL | - | |
| krige | logical | TRUE | TRUE, FALSE | - |
| linburn | logical | FALSE | TRUE, FALSE | - |
| m0r1 | logical | TRUE | TRUE, FALSE | - |
| MAP | logical | TRUE | TRUE, FALSE | - |
| meanfn | character | linear | constant, linear | - |
| nu | numeric | 1.5 | |
|
| pred.n | logical | - | TRUE, FALSE | - |
| R | integer | 1 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| verb | integer | - | |
|
| zcov | logical | FALSE | TRUE, FALSE | - |
| tree | untyped | c(0.5, 2) | - | |
| gamma | untyped | c(10, 0.2, 0.7) | - | |
| BTE | untyped | c(2000L, 7000L, 2L) | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBtgpllm
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBtgpllm$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrBtgpllm$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Gramacy RB (2007). “tgp: An R Package for Bayesian Nonstationary, Semiparametric Nonlinear Regression and Design by Treed Gaussian Process Models.” Journal of Statistical Software, 19(9), 1–46. doi:10.18637/jss.v019.i09.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.btgpllm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.btgpllm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bayesian treed linear model regression.
Calls tgp::btlm() from tgp.
For the predicted mean ZZ.km and for the predicted variance ZZ.ks2 are chosen.
Factor features are one-hot encoded with reference encoding before fitting.
If factors are present, basemax is set to the number of non-factor features
so that tree proposals account for the numeric part of the design.
verb is initialized to 0 to silence printing.
pred.n is initialized to FALSE to skip prediction during training.
This Learner can be instantiated via lrn():
lrn("regr.btlm")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, tgp
| Id | Type | Default | Levels | Range |
| meanfn | character | linear | constant, linear | - |
| bprior | character | bflat | b0, b0not, bflat, bmle, bmznot, bmzt | - |
| tree | untyped | c(0.5, 2) | - | |
| BTE | untyped | c(2000L, 7000L, 2L) | - | |
| R | integer | 1 | |
|
| m0r1 | logical | TRUE | TRUE, FALSE | - |
| itemps | untyped | NULL | - | |
| pred.n | logical | - | TRUE, FALSE | - |
| krige | logical | TRUE | TRUE, FALSE | - |
| zcov | logical | FALSE | TRUE, FALSE | - |
| Ds2x | logical | FALSE | TRUE, FALSE | - |
| improv | logical | FALSE | TRUE, FALSE | - |
| trace | logical | FALSE | TRUE, FALSE | - |
| verb | integer | - | |
|
| MAP | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrBtlm
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrBtlm$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrBtlm$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Gramacy RB (2007). “tgp: An R Package for Bayesian Nonstationary, Semiparametric Nonlinear Regression and Design by Treed Gaussian Process Models.” Journal of Statistical Software, 19(9), 1–46. doi:10.18637/jss.v019.i09.
Gramacy RB, Taddy M (2010). “Categorical Inputs, Sensitivity Analysis, Optimization and Importance Tempering with tgp Version 2, an R Package for Treed Gaussian Process Models.” Journal of Statistical Software, 33(6), 1–48. doi:10.18637/jss.v033.i06.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.btlm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.btlm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Gradient boosting algorithm that also supports categorical data.
Calls catboost::catboost.train() from package 'catboost'.
This Learner can be instantiated via lrn():
lrn("regr.catboost")
Task type: “regr”
Predict Types: “response”
Feature Types: “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, catboost
| Id | Type | Default | Levels | Range |
| loss_function | character | RMSE | MAE, MAPE, Poisson, Quantile, RMSE, LogLinQuantile, Lq, Huber, Expectile, Tweedie | - |
| learning_rate | numeric | 0.03 | |
|
| random_seed | integer | 0 | |
|
| l2_leaf_reg | numeric | 3 | |
|
| bootstrap_type | character | - | Bayesian, Bernoulli, MVS, Poisson, No | - |
| bagging_temperature | numeric | 1 | |
|
| subsample | numeric | - | |
|
| sampling_frequency | character | PerTreeLevel | PerTree, PerTreeLevel | - |
| sampling_unit | character | Object | Object, Group | - |
| mvs_reg | numeric | - | |
|
| random_strength | numeric | 1 | |
|
| depth | integer | 6 | |
|
| grow_policy | character | SymmetricTree | SymmetricTree, Depthwise, Lossguide | - |
| min_data_in_leaf | integer | 1 | |
|
| max_leaves | integer | 31 | |
|
| has_time | logical | FALSE | TRUE, FALSE | - |
| rsm | numeric | 1 | |
|
| nan_mode | character | Min | Min, Max | - |
| fold_permutation_block | integer | - | |
|
| leaf_estimation_method | character | - | Newton, Gradient, Exact | - |
| leaf_estimation_iterations | integer | - | |
|
| leaf_estimation_backtracking | character | AnyImprovement | No, AnyImprovement, Armijo | - |
| fold_len_multiplier | numeric | 2 | |
|
| approx_on_full_history | logical | TRUE | TRUE, FALSE | - |
| boosting_type | character | - | Ordered, Plain | - |
| boost_from_average | logical | - | TRUE, FALSE | - |
| langevin | logical | FALSE | TRUE, FALSE | - |
| diffusion_temperature | numeric | 10000 | |
|
| score_function | character | Cosine | Cosine, L2, NewtonCosine, NewtonL2 | - |
| monotone_constraints | untyped | - | - | |
| feature_weights | untyped | - | - | |
| first_feature_use_penalties | untyped | - | - | |
| penalties_coefficient | numeric | 1 | |
|
| per_object_feature_penalties | untyped | - | - | |
| model_shrink_rate | numeric | - | |
|
| model_shrink_mode | character | - | Constant, Decreasing | - |
| target_border | numeric | - | |
|
| border_count | integer | - | |
|
| feature_border_type | character | GreedyLogSum | Median, Uniform, UniformAndQuantiles, MaxLogSum, MinEntropy, GreedyLogSum | - |
| per_float_feature_quantization | untyped | - | - | |
| thread_count | integer | 1 | |
|
| task_type | character | CPU | CPU, GPU | - |
| devices | untyped | - | - | |
| logging_level | character | Silent | Silent, Verbose, Info, Debug | - |
| metric_period | integer | 1 | |
|
| train_dir | untyped | "catboost_info" | - | |
| model_size_reg | numeric | 0.5 | |
|
| allow_writing_files | logical | FALSE | TRUE, FALSE | - |
| save_snapshot | logical | FALSE | TRUE, FALSE | - |
| snapshot_file | untyped | - | - | |
| snapshot_interval | integer | 600 | |
|
| simple_ctr | untyped | - | - | |
| combinations_ctr | untyped | - | - | |
| ctr_target_border_count | integer | - | |
|
| counter_calc_method | character | Full | SkipTest, Full | - |
| max_ctr_complexity | integer | - | |
|
| ctr_leaf_count_limit | integer | - | |
|
| store_all_simple_ctr | logical | FALSE | TRUE, FALSE | - |
| final_ctr_computation_mode | character | Default | Default, Skip | - |
| verbose | logical | FALSE | TRUE, FALSE | - |
| ntree_start | integer | 0 | |
|
| ntree_end | integer | 0 | |
|
| early_stopping_rounds | integer | - | |
|
| eval_metric | untyped | - | - | |
| use_best_model | logical | - | TRUE, FALSE | - |
| iterations | integer | 1000 |
|
See https://catboost.ai/en/docs/concepts/r-installation.
logging_level:
Actual default: "Verbose"
Adjusted default: "Silent"
Reason for change: consistent with other mlr3 learners
thread_count:
Actual default: -1
Adjusted default: 1
Reason for change: consistent with other mlr3 learners
allow_writing_files:
Actual default: TRUE
Adjusted default: FALSE
Reason for change: consistent with other mlr3 learners
save_snapshot:
Actual default: TRUE
Adjusted default: FALSE
Reason for change: consistent with other mlr3 learners
Early stopping can be used to find the optimal number of boosting rounds.
Set early_stopping_rounds to an integer value to monitor the performance of the model on the validation set while training.
For information on how to configure the validation set, see the Validation section of mlr3::Learner.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrCatboost
internal_valid_scoresThe last observation of the validation scores for all metrics.
Extracted from model$evaluation_log
internal_tuned_valuesReturns the early stopped iterations if early_stopping_rounds was set during training.
validateHow to construct the internal validation data. This parameter can be either NULL, a ratio, "test", or "predefined".
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Create a LearnerRegrCatboost object.
LearnerRegrCatboost$new()
importance()
The importance scores are calculated using
catboost::catboost.get_feature_importance(),
setting type = "FeatureImportance", returned for 'all'.
LearnerRegrCatboost$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerRegrCatboost$clone(deep = FALSE)
deepWhether to make a deep clone.
sumny
Dorogush, Veronika A, Ershov, Vasily, Gulin, Andrey (2018). “CatBoost: gradient boosting with categorical features support.” arXiv preprint arXiv:1810.11363.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.catboost") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.catboost") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
A random forest based on conditional inference trees (partykit::ctree()).
Calls partykit::cforest() from partykit.
This Learner can be instantiated via lrn():
lrn("regr.cforest")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, partykit, sandwich, coin
| Id | Type | Default | Levels | Range |
| ntree | integer | 500 | |
|
| replace | logical | FALSE | TRUE, FALSE | - |
| fraction | numeric | 0.632 | |
|
| mtry | integer | - | |
|
| mtryratio | numeric | - | |
|
| applyfun | untyped | - | - | |
| cores | integer | NULL | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| cluster | untyped | - | - | |
| scores | untyped | - | - | |
| teststat | character | quadratic | quadratic, maximum | - |
| splitstat | character | quadratic | quadratic, maximum | - |
| splittest | logical | FALSE | TRUE, FALSE | - |
| testtype | character | Univariate | Bonferroni, MonteCarlo, Univariate, Teststatistic | - |
| nmax | untyped | - | - | |
| pargs | untyped | - | - | |
| alpha | numeric | 0.05 | |
|
| mincriterion | numeric | 0 | |
|
| logmincriterion | numeric | 0 | |
|
| minsplit | integer | 20 | |
|
| minbucket | integer | 7 | |
|
| minprob | numeric | 0.01 | |
|
| stump | logical | FALSE | TRUE, FALSE | - |
| lookahead | logical | FALSE | TRUE, FALSE | - |
| MIA | logical | FALSE | TRUE, FALSE | - |
| maxvar | integer | - | |
|
| nresample | integer | 9999 | |
|
| tol | numeric | 1.490116e-08 | |
|
| maxsurrogate | integer | 0 | |
|
| numsurrogate | logical | FALSE | TRUE, FALSE | - |
| maxdepth | integer | Inf | |
|
| multiway | logical | FALSE | TRUE, FALSE | - |
| splittry | integer | 2 | |
|
| intersplit | logical | FALSE | TRUE, FALSE | - |
| majority | logical | FALSE | TRUE, FALSE | - |
| caseweights | logical | TRUE | TRUE, FALSE | - |
| saveinfo | logical | FALSE | TRUE, FALSE | - |
| update | logical | FALSE | TRUE, FALSE | - |
| splitflavour | character | ctree | ctree, exhaustive | - |
| OOB | logical | FALSE | TRUE, FALSE | - |
| simplify | logical | TRUE | TRUE, FALSE | - |
| scale | logical | TRUE | TRUE, FALSE | - |
| nperm | integer | 1 | |
|
| risk | character | loglik | loglik, misclassification | - |
| conditional | logical | FALSE | TRUE, FALSE | - |
| threshold | numeric | 0.2 |
|
mtry:
This hyperparameter can alternatively be set via the added hyperparameter mtryratio
as mtry = max(ceiling(mtryratio * n_features), 1).
Note that mtry and mtryratio are mutually exclusive.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrCForest
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrCForest$new()
oob_error()
The out-of-bag error, calculated using the OOB predictions from
partykit.
LearnerRegrCForest$oob_error()
numeric(1).
clone()
The objects of this class are cloneable with this method.
LearnerRegrCForest$clone(deep = FALSE)
deepWhether to make a deep clone.
sumny
Hothorn T, Zeileis A (2015). “partykit: A Modular Toolkit for Recursive Partytioning in R.” Journal of Machine Learning Research, 16(118), 3905-3909. http://jmlr.org/papers/v16/hothorn15a.html.
Hothorn T, Hornik K, Zeileis A (2006). “Unbiased Recursive Partitioning: A Conditional Inference Framework.” Journal of Computational and Graphical Statistics, 15(3), 651–674. doi:10.1198/106186006x133933, https://doi.org/10.1198/106186006x133933.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.cforest") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.cforest") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Categorical Regression Splines.
Calls crs::crs() from crs.
This Learner can be instantiated via lrn():
lrn("regr.crs")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| degree | integer | 3 | |
|
| segments | integer | 1 | |
|
| include | integer | - | |
|
| lambda | untyped | - | - | |
| lambda.discrete | logical | FALSE | TRUE, FALSE | - |
| lambda.discrete.num | integer | 100 | |
|
| cv | character | nomad | nomad, exhaustive, none | - |
| cv.threshold | integer | 1000 | |
|
| cv.func | character | cv.ls | cv.ls, cv.gcv, cv.aic | - |
| kernel | logical | TRUE | TRUE, FALSE | - |
| degree.max | integer | 10 | |
|
| segments.max | integer | 10 | |
|
| degree.min | integer | 0 | |
|
| segments.min | integer | 1 | |
|
| cv.df.min | integer | 1 | |
|
| complexity | character | degree-knots | degree-knots, degree, knots | - |
| knots | character | quantiles | quantiles, uniform, auto | - |
| basis | character | auto | auto, additive, tensor, glp | - |
| prune | logical | FALSE | TRUE, FALSE | - |
| restarts | integer | 0 | |
|
| nmulti | integer | 5 | |
|
| singular.ok | logical | FALSE | TRUE, FALSE | - |
| deriv | integer | 0 | |
|
| data.return | logical | FALSE | TRUE, FALSE | - |
| model.return | logical | FALSE | TRUE, FALSE | - |
| random.seed | integer | - | |
|
| tau | numeric | - | |
|
| initial.mesh.size.real | untyped | - | - | |
| initial.mesh.size.integer | untyped | - | - | |
| max.bb.eval | untyped | - | - | |
| min.mesh.size.real | untyped | - | - | |
| min.mesh.size.integer | untyped | - | - | |
| min.frame.size.real | untyped | - | - | |
| min.frame.size.integer | untyped | - | - | |
| display.nomad.progress | logical | TRUE | TRUE, FALSE | - |
| display.warnings | logical | TRUE | TRUE, FALSE | - |
| opts | untyped | - | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrCrs
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrCrs$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrCrs$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.crs", cv = "none") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.crs", cv = "none") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Regression Partition Tree where a significance test is used to determine the univariate splits.
Calls partykit::ctree() from partykit.
This Learner can be instantiated via lrn():
lrn("regr.ctree")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, partykit, sandwich, coin
| Id | Type | Default | Levels | Range |
| teststat | character | quadratic | quadratic, maximum | - |
| splitstat | character | quadratic | quadratic, maximum | - |
| splittest | logical | FALSE | TRUE, FALSE | - |
| testtype | character | Bonferroni | Bonferroni, MonteCarlo, Univariate, Teststatistic | - |
| nmax | untyped | - | - | |
| alpha | numeric | 0.05 | |
|
| mincriterion | numeric | 0.95 | |
|
| logmincriterion | numeric | - | |
|
| minsplit | integer | 20 | |
|
| minbucket | integer | 7 | |
|
| minprob | numeric | 0.01 | |
|
| stump | logical | FALSE | TRUE, FALSE | - |
| lookahead | logical | FALSE | TRUE, FALSE | - |
| MIA | logical | FALSE | TRUE, FALSE | - |
| maxvar | integer | - | |
|
| nresample | integer | 9999 | |
|
| tol | numeric | - | |
|
| maxsurrogate | integer | 0 | |
|
| numsurrogate | logical | FALSE | TRUE, FALSE | - |
| mtry | integer | Inf | |
|
| maxdepth | integer | Inf | |
|
| multiway | logical | FALSE | TRUE, FALSE | - |
| splittry | integer | 2 | |
|
| intersplit | logical | FALSE | TRUE, FALSE | - |
| majority | logical | FALSE | TRUE, FALSE | - |
| caseweights | logical | FALSE | TRUE, FALSE | - |
| applyfun | untyped | - | - | |
| cores | integer | NULL | |
|
| saveinfo | logical | TRUE | TRUE, FALSE | - |
| update | logical | FALSE | TRUE, FALSE | - |
| splitflavour | character | ctree | ctree, exhaustive | - |
| cluster | untyped | - | - | |
| scores | untyped | - | - | |
| doFit | logical | TRUE | TRUE, FALSE | - |
| maxpts | integer | 25000 | |
|
| abseps | numeric | 0.001 | |
|
| releps | numeric | 0 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrCTree
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrCTree$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrCTree$clone(deep = FALSE)
deepWhether to make a deep clone.
sumny
Hothorn T, Zeileis A (2015). “partykit: A Modular Toolkit for Recursive Partytioning in R.” Journal of Machine Learning Research, 16(118), 3905-3909. http://jmlr.org/papers/v16/hothorn15a.html.
Hothorn T, Hornik K, Zeileis A (2006). “Unbiased Recursive Partitioning: A Conditional Inference Framework.” Journal of Computational and Graphical Statistics, 15(3), 651–674. doi:10.1198/106186006x133933, https://doi.org/10.1198/106186006x133933.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.ctree") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.ctree") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Rule-based model that is an extension of Quinlan's M5 model tree. Each tree contains
linear regression models at the terminal leaves.
Calls Cubist::cubist() from Cubist.
This Learner can be instantiated via lrn():
lrn("regr.cubist")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, Cubist
| Id | Type | Default | Levels | Range |
| committees | integer | - | |
|
| unbiased | logical | FALSE | TRUE, FALSE | - |
| rules | integer | 100 | |
|
| extrapolation | numeric | 100 | |
|
| sample | integer | 0 | |
|
| seed | integer | - | |
|
| label | untyped | "outcome" | - | |
| neighbors | integer | - | |
|
| strip_time_stamps | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrCubist
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrCubist$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrCubist$clone(deep = FALSE)
deepWhether to make a deep clone.
sumny
Quinlan, R J, others (1992). “Learning with continuous classes.” In 5th Australian joint conference on artificial intelligence, volume 92, 343–348. World Scientific.
Quinlan, Ross J (1993). “Combining instance-based and model-based learning.” In Proceedings of the tenth international conference on machine learning, 236–243.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.cubist") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.cubist") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
MCP- or SCAD-penalized regression models with k-fold cross validation
for choosing the regularization parameter lambda.
Calls ncvreg::cv.ncvreg() from package ncvreg with family set to
"gaussian" (default). Poisson family is also supported.
Covariates are internally standardized by ncvreg prior to model fitting.
This Learner can be instantiated via lrn():
lrn("regr.cv_ncvreg")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, ncvreg
| Id | Type | Default | Levels | Range |
| family | character | gaussian | gaussian, poisson | - |
| penalty | character | MCP | MCP, SCAD, lasso | - |
| gamma | numeric | - | |
|
| alpha | numeric | 1 | |
|
| lambda.min | numeric | - | |
|
| nlambda | integer | 100 | |
|
| lambda | untyped | - | - | |
| eps | numeric | 1e-04 | |
|
| max.iter | integer | 10000 | |
|
| convex | logical | TRUE | TRUE, FALSE | - |
| dfmax | integer | - | |
|
| penalty.factor | untyped | - | - | |
| warn | logical | TRUE | TRUE, FALSE | - |
| returnX | logical | TRUE | TRUE, FALSE | - |
| cluster | untyped | - | - | |
| nfolds | integer | 10 | |
|
| fold | untyped | - | - | |
| returnY | logical | FALSE | TRUE, FALSE | - |
| trace | logical | FALSE | TRUE, FALSE | - |
| pred_lambda | numeric | - |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrNCVreg
new()
Creates a new instance of this R6 class.
LearnerRegrNCVreg$new()
selected_features()
Returns the set of selected features which have non-zero coefficients.
Calls the internal coef.cv.ncvreg() function.
LearnerRegrNCVreg$selected_features(lambda = NULL)
lambda(numeric(1))
Custom lambda, defaults to the lambda with the minimum CV error.
(character()) vector of feature names.
clone()
The objects of this class are cloneable with this method.
LearnerRegrNCVreg$clone(deep = FALSE)
deepWhether to make a deep clone.
bblodfon
Breheny P, Huang J (2011). “Coordinate descent algorithms for nonconvex penalized regression, with applications to biological feature selection.” Annals of Applied Statistics, 5(1), 232–253. ISSN 1932-6157, doi:10.1214/10-AOAS388.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.cv_ncvreg") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.cv_ncvreg") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Decision Stump Learner.
Calls RWeka::DecisionStump() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("regr.decision_stump")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrDecisionStump
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrDecisionStump$new()
marshal()
Marshal the learner's model.
LearnerRegrDecisionStump$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrDecisionStump$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrDecisionStump$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.decision_stump") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.decision_stump") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Simple Decision Table majority regressor.
Calls RWeka::make_Weka_classifier() from RWeka.
E:
Has only 2 out of 4 original evaluation measures : rmse and mae with rmse being the default
Reason for change: this learner should only contain evaluation measures appropriate for regression tasks
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
P_best:
original id: P
D_best:
original id: D
N_best:
original id: N
S_best:
original id: S
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("regr.decision_table")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| S | character | BestFirst | BestFirst, GreedyStepwise | - |
| X | integer | 1 | |
|
| E | character | rmse | rmse, mae | - |
| I | logical | - | TRUE, FALSE | - |
| R | logical | - | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| P_best | untyped | - | - | |
| D_best | character | 1 | 0, 1, 2 | - |
| N_best | integer | - | |
|
| S_best | integer | 1 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrDecisionTable
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrDecisionTable$new()
marshal()
Marshal the learner's model.
LearnerRegrDecisionTable$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrDecisionTable$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrDecisionTable$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Kohavi R (1995). “The Power of Decision Tables.” In 8th European Conference on Machine Learning, 174–189.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.decision_table") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.decision_table") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
This is an alternative implementation of MARS (Multivariate Adaptive Regression Splines). MARS is trademarked and thus not used as the name. The name "earth" stands for "Enhanced Adaptive Regression Through Hinges".
Calls earth::earth() from earth.
Methods for variance estimations are not yet implemented.
This Learner can be instantiated via lrn():
lrn("regr.earth")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, earth
| Id | Type | Default | Levels | Range |
| wp | untyped | NULL | - | |
| offset | untyped | NULL | - | |
| keepxy | logical | FALSE | TRUE, FALSE | - |
| trace | character | 0 | 0, .3, .5, 1, 2, 3, 4, 5 | - |
| degree | integer | 1 | |
|
| penalty | numeric | 2 | |
|
| nk | untyped | NULL | - | |
| thresh | numeric | 0.001 | |
|
| minspan | numeric | 0 | |
|
| endspan | numeric | 0 | |
|
| newvar.penalty | numeric | 0 | |
|
| fast.k | integer | 20 | |
|
| fast.beta | integer | 1 | |
|
| linpreds | untyped | FALSE | - | |
| allowed | untyped | - | - | |
| pmethod | character | backward | backward, none, exhaustive, forward, seqrep, cv | - |
| nprune | integer | - | |
|
| nfold | integer | 0 | |
|
| ncross | integer | 1 | |
|
| stratify | logical | TRUE | TRUE, FALSE | - |
| varmod.method | character | none | none, const, lm, rlm, earth, gam, power, power0, x.lm, x.rlm, [...] | - |
| varmod.exponent | numeric | 1 | |
|
| varmod.conv | numeric | 1 | |
|
| varmod.clamp | numeric | 0.1 | |
|
| varmod.minspan | numeric | -3 | |
|
| Scale.y | logical | FALSE | TRUE, FALSE | - |
| Adjust.endspan | numeric | 2 | |
|
| Auto.linpreds | logical | TRUE | TRUE, FALSE | - |
| Force.weights | logical | FALSE | TRUE, FALSE | - |
| Use.beta.cache | logical | TRUE | TRUE, FALSE | - |
| Force.xtx.prune | logical | FALSE | TRUE, FALSE | - |
| Get.leverages | logical | TRUE | TRUE, FALSE | - |
| Exhaustive.tol | numeric | 1e-10 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrEarth
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrEarth$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrEarth$clone(deep = FALSE)
deepWhether to make a deep clone.
pkopper
Milborrow, Stephen, Hastie, T, Tibshirani, R (2014). “Earth: multivariate adaptive regression spline models.” R package version, 3(7).
Friedman, H J (1991). “Multivariate adaptive regression splines.” The annals of statistics, 19(1), 1–67.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.earth") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.earth") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Evolutionary learning of globally optimal regression trees.
Calls evtree::evtree() fromevtree.
pmutatemajor, pmutateminor, pcrossover, psplit, and pprune,
are scaled internally to sum to 100.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrEvtree
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrEvtree$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrEvtree$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Linear Regression, where the features used in the model are selected by running Exhaustive Search.
Calls ExhaustiveSearch::ExhaustiveSearch() from ExhaustiveSearch.
family:
Actual default: NULL
Adjusted default: "gaussian"
Reason for change: To comply with mlr3 architecture, we differentiate between classification and regression learners.
nThreads:
Actual default: NULL
Adjusted default: 1
Reason for change: Suppressing the automatic internal parallelization if
cv.folds > 0.
quietly:
Actual default: FALSE
Adjusted default: TRUE
Reason for change: Suppression of constant printing to console
This Learner can be instantiated via lrn():
lrn("regr.exhaustive_search")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, ExhaustiveSearch
| Id | Type | Default | Levels | Range |
| family | character | - | gaussian, binomial | - |
| performanceMeasure | character | - | MSE, AIC | - |
| combsUpTo | integer | - | |
|
| nResults | integer | 5000 | |
|
| nThreads | integer | - | |
|
| testSetIDs | integer | - | |
|
| errorVal | untyped | -1 | - | |
| quietly | logical | - | TRUE, FALSE | - |
| checkLarge | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrExhaustiveSearch
new()
Creates a new instance of this R6 class.
LearnerRegrExhaustiveSearch$new()
selected_features()
Extracts selected features of this learner.
LearnerRegrExhaustiveSearch$selected_features()
clone()
The objects of this class are cloneable with this method.
LearnerRegrExhaustiveSearch$clone(deep = FALSE)
deepWhether to make a deep clone.
ngerman
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# define learner learner = lrn("regr.exhaustive_search", predict_type = "se") # define task tsk_cars = tsk("mtcars") # train learner learner$train(tsk_cars) # extract selected features learner$selected_features() # predict on training task learner$predict(tsk_cars)# define learner learner = lrn("regr.exhaustive_search", predict_type = "se") # define task tsk_cars = tsk("mtcars") # train learner learner$train(tsk_cars) # extract selected features learner$selected_features() # predict on training task learner$predict(tsk_cars)
Fast Nearest Neighbour Regression.
Calls FNN::knn.reg() from FNN.
This Learner can be instantiated via lrn():
lrn("regr.fnn")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, FNN
| Id | Type | Default | Levels | Range |
| k | integer | 1 | |
|
| algorithm | character | kd_tree | kd_tree, cover_tree, brute | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrFNN
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrFNN$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrFNN$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Boltz, Sylvain, Debreuve, Eric, Barlaud, Michel (2007). “kNN-based high-dimensional Kullback-Leibler distance for tracking.” In Eighth International Workshop on Image Analysis for Multimedia Interactive Services (WIAMIS'07), 16–16. IEEE.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.fnn") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.fnn") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Fuzzy rule-based regression learner supporting multiple inference engines such as WM, HYFIS,
ANFIS, DENFIS, SBC, and several genetic fuzzy systems.
Calls frbs::frbs.learn() from frbs.
This Learner can be instantiated via lrn():
lrn("regr.frbs")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, frbs
| Id | Type | Default | Levels | Range |
| alpha.heuristic | numeric | 1 | |
|
| d | numeric | 2 | |
|
| Dthr | numeric | 0.1 | |
|
| eps.high | numeric | 0.5 | |
|
| eps.low | numeric | 0.15 | |
|
| epsilon | numeric | 0.9 | |
|
| max.gen | integer | 10 | |
|
| max.iter | integer | 10 | |
|
| max.tune | integer | 10 | |
|
| method.type | character | WM | WM, SBC, HYFIS, ANFIS, DENFIS, FS.HGD, FIR.DM, GFS.FR.MOGUL, GFS.THRIFT, GFS.LT.RS | - |
| mode.tuning | character | GLOBAL | GLOBAL, LOCAL | - |
| num.labels | integer | 7 | |
|
| persen_cross | numeric | 1 | |
|
| persen_mutant | numeric | 1 | |
|
| popu.size | integer | 10 | |
|
| r.a | numeric | 0.5 | |
|
| range.data | untyped | NULL | - | |
| rule.selection | logical | FALSE | TRUE, FALSE | - |
| step.size | numeric | 0.01 | |
|
| type.defuz | character | WAM | WAM, FIRST.MAX, LAST.MAX, MEAN.MAX, COG | - |
| type.implication.func | character | ZADEH | DIENES_RESHER, LUKASIEWICZ, ZADEH, GOGUEN, GODEL, SHARP, MIZUMOTO, DUBOIS_PRADE, MIN | - |
| type.mf | character | GAUSSIAN | TRIANGLE, TRAPEZOID, GAUSSIAN, SIGMOID, BELL | - |
| type.snorm | character | MAX | MAX, HAMACHER, YAGER, PRODUCT, BOUNDED | - |
| type.tnorm | character | MIN | MIN, HAMACHER, YAGER, PRODUCT, BOUNDED | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrFrbs
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrFrbs$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrFrbs$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Riza LS, Bergmeir C, Herrera F, Benitez JM (2015). “frbs: Fuzzy Rule-Based Systems for Classification and Regression in R.” Journal of Statistical Software, 65(6), 1–30. http://www.jstatsoft.org/v65/i06/.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.frbs") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.frbs") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Generalized additive models. Calls mgcv::gam() from package mgcv.
A gam formula specific to the task at hand is required for the formula
parameter (see example and ?mgcv::formula.gam). Beware, if no formula is provided, a fallback formula is
used that will make the gam behave like a glm (this behavior is required
for the unit tests). Only features specified in the formula will be used,
superseding columns with col_roles "feature" in the task.
If a Task contains a column with the offset role, it is automatically
incorporated during training via the offset argument in mgcv::gam().
No offset is applied during prediction for this learner.
This Learner can be instantiated via lrn():
lrn("regr.gam")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, mgcv
| Id | Type | Default | Levels | Range |
| family | character | gaussian | gaussian, poisson | - |
| formula | untyped | - | - | |
| method | character | GCV.Cp | GCV.Cp, GACV.Cp, REML, P-REML, ML, P-ML | - |
| optimizer | untyped | c("outer", "newton") | - | |
| scale | numeric | 0 | |
|
| select | logical | FALSE | TRUE, FALSE | - |
| knots | untyped | NULL | - | |
| sp | untyped | NULL | - | |
| min.sp | untyped | NULL | - | |
| H | untyped | NULL | - | |
| gamma | numeric | 1 | |
|
| paraPen | untyped | NULL | - | |
| G | untyped | NULL | - | |
| in.out | untyped | NULL | - | |
| drop.unused.levels | logical | TRUE | TRUE, FALSE | - |
| drop.intercept | logical | FALSE | TRUE, FALSE | - |
| nei | untyped | - | - | |
| nthreads | integer | 1 | |
|
| irls.reg | numeric | 0 | |
|
| epsilon | numeric | 1e-07 | |
|
| maxit | integer | 200 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| mgcv.tol | numeric | 1e-07 | |
|
| mgcv.half | integer | 15 | |
|
| rank.tol | numeric | 1.490116e-08 | |
|
| nlm | untyped | list() | - | |
| optim | untyped | list() | - | |
| newton | untyped | list() | - | |
| idLinksBases | logical | TRUE | TRUE, FALSE | - |
| scalePenalty | logical | TRUE | TRUE, FALSE | - |
| efs.lspmax | integer | 15 | |
|
| efs.tol | numeric | 0.1 | |
|
| scale.est | character | fletcher | fletcher, pearson, deviance | - |
| ncv.threads | integer | 1 | |
|
| edge.correct | logical | FALSE | TRUE, FALSE | - |
| block.size | integer | 1000 | |
|
| unconditional | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrGam
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrGam$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrGam$clone(deep = FALSE)
deepWhether to make a deep clone.
pierrecamilleri
Hastie, J T, Tibshirani, J R (2017). Generalized additive models. Routledge.
Wood, Simon (2012). “mgcv: Mixed GAM Computation Vehicle with GCV/AIC/REML smoothness estimation.”
# simple example t = tsk("mtcars") l = lrn("regr.gam") l$param_set$values$formula = mpg ~ cyl + am + s(disp) + s(hp) l$train(t) l$model# simple example t = tsk("mtcars") l = lrn("regr.gam") l$param_set$values$formula = mpg ~ cyl + am + s(disp) + s(hp) l$train(t) l$model
Fit a generalized additive regression model using a boosting algorithm.
Calls mboost::gamboost() from mboost.
This Learner can be instantiated via lrn():
lrn("regr.gamboost")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, mboost
| Id | Type | Default | Levels | Range |
| baselearner | character | bbs | bbs, bols, btree | - |
| dfbase | integer | 4 | |
|
| family | character | Gaussian | Gaussian, Laplace, Huber, Poisson, GammaReg, NBinomial, Hurdle, custom | - |
| custom.family | untyped | - | - | |
| nuirange | untyped | c(0, 100) | - | |
| d | numeric | NULL | |
|
| mstop | integer | 100 | |
|
| nu | numeric | 0.1 | |
|
| risk | character | inbag | inbag, oobag, none | - |
| oobweights | untyped | NULL | - | |
| trace | logical | FALSE | TRUE, FALSE | - |
| stopintern | untyped | FALSE | - | |
| na.action | untyped | stats::na.omit | - |
If a Task contains a column with the offset role, it is automatically
incorporated via the offset argument in mboost's training function.
No offset is applied during prediction for this learner.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrGAMBoost
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Create a LearnerRegrGAMBoost object.
LearnerRegrGAMBoost$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrGAMBoost$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Bühlmann, Peter, Yu, Bin (2003). “Boosting with the L 2 loss: regression and classification.” Journal of the American Statistical Association, 98(462), 324–339.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
lrn("regr.gamboost")lrn("regr.gamboost")
Gaussian Processes.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
E_poly:
original id: E
L_poly:
original id: L (duplicated L for when K is set to PolyKernel)
C_poly:
original id: C
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
output-debug-info for kernel parameter removed:
enables debugging output (if available) to be printed
Reason for change: The parameter is removed because it's unclear how to actually use it.
This Learner can be instantiated via lrn():
lrn("regr.gaussian_processes")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| L | numeric | 1 | |
|
| N | character | 0 | 0, 1, 2 | - |
| K | character | supportVector.PolyKernel | supportVector.NormalizedPolyKernel, supportVector.PolyKernel, supportVector.Puk, supportVector.RBFKernel, supportVector.StringKernel | - |
| S | integer | 1 | |
|
| E_poly | numeric | 1 | |
|
| L_poly | logical | FALSE | TRUE, FALSE | - |
| C_poly | integer | 250007 | |
|
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrGaussianProcesses
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrGaussianProcesses$new()
marshal()
Marshal the learner's model.
LearnerRegrGaussianProcesses$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrGaussianProcesses$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrGaussianProcesses$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Mackay DJ (1998). “Introduction to Gaussian Processes.”
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.gaussian_processes") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.gaussian_processes") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Gaussian process for regression.
Calls kernlab::gausspr() from kernlab.
Parameters sigma, degree, scale, offset and order are
added to make tuning kpar easier. If kpar is provided then these
new parameters are ignored. If none are provided then the default
"automatic" is used for kpar.
This Learner can be instantiated via lrn():
lrn("regr.gausspr")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, kernlab
| Id | Type | Default | Levels | Range |
| scaled | untyped | TRUE | - | |
| kernel | character | rbfdot | rbfdot, polydot, vanilladot, tanhdot, laplacedot, besseldot, anovadot, splinedot | - |
| sigma | numeric | - | |
|
| degree | numeric | - | |
|
| scale | numeric | - | |
|
| offset | numeric | - | |
|
| order | numeric | - | |
|
| kpar | untyped | "automatic" | - | |
| var | numeric | 0.001 | |
|
| variance.model | logical | FALSE | TRUE, FALSE | - |
| tol | numeric | 0.001 | |
|
| fit | logical | TRUE | TRUE, FALSE | - |
| na.action | untyped | na.omit | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrGausspr
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrGausspr$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrGausspr$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Karatzoglou, Alexandros, Smola, Alex, Hornik, Kurt, Zeileis, Achim (2004). “kernlab-an S4 package for kernel methods in R.” Journal of statistical software, 11(9), 1–20.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.gausspr") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.gausspr") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Gradient Boosting Regression Algorithm.
Calls gbm::gbm() from gbm.
Weights are ignored for quantile prediction.
This Learner can be instantiated via lrn():
lrn("regr.gbm")
Task type: “regr”
Predict Types: “response”, “quantiles”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, gbm
| Id | Type | Default | Levels | Range |
| distribution | character | gaussian | gaussian, laplace, poisson, tdist | - |
| n.trees | integer | 100 | |
|
| interaction.depth | integer | 1 | |
|
| n.minobsinnode | integer | 10 | |
|
| shrinkage | numeric | 0.001 | |
|
| bag.fraction | numeric | 0.5 | |
|
| train.fraction | numeric | 1 | |
|
| cv.folds | integer | 0 | |
|
| keep.data | logical | FALSE | TRUE, FALSE | - |
| verbose | logical | FALSE | TRUE, FALSE | - |
| n.cores | integer | 1 | |
|
| var.monotone | untyped | - | - |
keep.data:
Actual default: TRUE
Adjusted default: FALSE
Reason for change: keep.data = FALSE saves memory during model fitting.
n.cores:
Actual default: NULL
Adjusted default: 1
Reason for change: Suppressing the automatic internal parallelization if
cv.folds > 0.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrGBM
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrGBM$new()
importance()
The importance scores are extracted by gbm::relative.influence() from
the model.
LearnerRegrGBM$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerRegrGBM$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Friedman, H J (2002). “Stochastic gradient boosting.” Computational statistics & data analysis, 38(4), 367–378.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
lrn("regr.gbm")lrn("regr.gbm")
Generalized linear model.
Calls stats::glm() from base package 'stats'.
For logistic regression please use mlr_learners_classif.log_reg.
This Learner can be instantiated via lrn():
lrn("regr.glm")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, 'stats'
| Id | Type | Default | Levels | Range |
| singular.ok | logical | TRUE | TRUE, FALSE | - |
| x | logical | FALSE | TRUE, FALSE | - |
| y | logical | TRUE | TRUE, FALSE | - |
| model | logical | TRUE | TRUE, FALSE | - |
| etastart | untyped | - | - | |
| mustart | untyped | - | - | |
| start | untyped | NULL | - | |
| family | character | gaussian | gaussian, poisson, quasipoisson, Gamma, inverse.gaussian | - |
| na.action | character | - | na.omit, na.pass, na.fail, na.exclude | - |
| link | character | - | logit, probit, cauchit, cloglog, identity, log, sqrt, 1/mu^2, inverse | - |
| epsilon | numeric | 1e-08 | |
|
| maxit | numeric | 25 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| dispersion | untyped | NULL | - | |
| type | character | link | response, link, terms | - |
| use_pred_offset | logical | TRUE | TRUE, FALSE | - |
type
Actual default: "link"
Adjusted default: "response"
Reason for change: Response scale more natural for predictions.
If a Task has a column with the role offset, it will automatically be used during training.
The offset is incorporated through the formula interface to ensure compatibility with stats::glm().
We add it to the model formula as offset(<column_name>) and also include it in the training data.
During prediction, the default behavior is to use the offset column from the
test set (enabled by use_pred_offset = TRUE).
Otherwise, if the user sets use_pred_offset = FALSE, a zero offset is applied,
effectively disabling the offset adjustment during prediction.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrGlm
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrGlm$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrGlm$clone(deep = FALSE)
deepWhether to make a deep clone.
salauer
Hosmer Jr, W D, Lemeshow, Stanley, Sturdivant, X R (2013). Applied logistic regression, volume 398. John Wiley & Sons.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.glm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.glm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Fit a generalized linear regression model using a boosting algorithm.
Calls mboost::glmboost() from mboost.
This Learner can be instantiated via lrn():
lrn("regr.glmboost")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, mboost
| Id | Type | Default | Levels | Range |
| family | character | Gaussian | Gaussian, Laplace, Huber, Poisson, GammaReg, NBinomial, Hurdle, custom | - |
| custom.family | untyped | - | - | |
| nuirange | untyped | c(0, 100) | - | |
| d | numeric | NULL | |
|
| center | logical | TRUE | TRUE, FALSE | - |
| mstop | integer | 100 | |
|
| nu | numeric | 0.1 | |
|
| risk | character | inbag | inbag, oobag, none | - |
| oobweights | untyped | NULL | - | |
| trace | logical | FALSE | TRUE, FALSE | - |
| stopintern | untyped | FALSE | - | |
| na.action | untyped | stats::na.omit | - | |
| contrasts.arg | untyped | - | - |
If a Task contains a column with the offset role, it is automatically
incorporated via the offset argument in mboost's training function.
No offset is applied during prediction for this learner.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrGLMBoost
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Create a LearnerRegrGLMBoost object.
LearnerRegrGLMBoost$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrGLMBoost$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Bühlmann, Peter, Yu, Bin (2003). “Boosting with the L 2 loss: regression and classification.” Journal of the American Statistical Association, 98(462), 324–339.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.glmboost") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.glmboost") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Gaussian process regression via GPfit::GP_fit() from GPfit.
This Learner can be instantiated via lrn():
lrn("regr.gpfit")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, GPfit
| Id | Type | Default | Levels | Range |
| control | untyped | NULL | - | |
| nug_thres | numeric | - | |
|
| trace | logical | - | TRUE, FALSE | - |
| maxit | integer | - | |
|
| optim_start | untyped | - | - | |
| scale | logical | - | TRUE, FALSE | - |
| type | character | exponential | exponential, matern | - |
| matern_nu_k | integer | 0 | |
|
| power | numeric | 1.95 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrGPfit
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrGPfit$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrGPfit$clone(deep = FALSE)
deepWhether to make a deep clone.
As the optimization routine assumes that the inputs are scaled to the unit hypercube,
the input gets scaled for each variable by default.
If this is not wanted, scale = FALSE`` has to be set. We replace the GPfit parameter corr = list(type = 'exponential',power = 1.95)to be separate parameterstypeandpower, in the case of corr = list(type = 'matern', nu = 0.5), the separate parameters are typeandmatern_nu_k = 0, and nu is computed by nu = (2 * matern_nu_k + 1) / 2 = 0.5'.
awinterstetter
MacDonald, B., Ranjan, P., Chipman, H. (2015). “GPfit: An R package for fitting a Gaussian process model to deterministic simulator outputs.” Journal of Statistical Software, 64, 1–23. ISSN 1548-7660, doi:10.18637/jss.v064.i12.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.gpfit", maxit = 1) print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.gpfit", maxit = 1) print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Regression feed-forward multilayer artificial neural network learner.
Class h2o::h2o.deeplearning() from package h2o.
This Learner can be instantiated via lrn():
lrn("regr.h2o.deeplearning")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, h2o
| Id | Type | Default | Levels | Range |
| activation | character | Rectifier | Rectifier, Tanh, TanhWithDropout, RectifierWithDropout, Maxout, MaxoutWithDropout | - |
| adaptive_rate | logical | TRUE | TRUE, FALSE | - |
| autoencoder | logical | FALSE | TRUE, FALSE | - |
| average_activation | numeric | 0 | |
|
| categorical_encoding | character | AUTO | AUTO, Enum, OneHotInternal, OneHotExplicit, Binary, Eigen, LabelEncoder, SortByResponse, EnumLimited | - |
| checkpoint | untyped | NULL | - | |
| diagnostics | logical | TRUE | TRUE, FALSE | - |
| distribution | character | AUTO | AUTO, gaussian, poisson, gamma, tweedie, laplace, huber, quantile | - |
| elastic_averaging | logical | FALSE | TRUE, FALSE | - |
| elastic_averaging_moving_rate | numeric | 0.9 | |
|
| elastic_averaging_regularization | numeric | 0.001 | |
|
| epochs | numeric | 10 | |
|
| epsilon | numeric | 1e-08 | |
|
| export_checkpoints_dir | untyped | NULL | - | |
| export_weights_and_biases | logical | FALSE | TRUE, FALSE | - |
| fast_mode | logical | TRUE | TRUE, FALSE | - |
| force_load_balance | logical | TRUE | TRUE, FALSE | - |
| hidden | untyped | c(200L, 200L) | - | |
| hidden_dropout_ratios | numeric | 0.5 | |
|
| huber_alpha | numeric | 0.9 | |
|
| ignore_const_cols | logical | TRUE | TRUE, FALSE | - |
| initial_weight_distribution | character | UniformAdaptive | UniformAdaptive, Uniform, Normal | - |
| initial_weight_scale | numeric | 1 | |
|
| input_dropout_ratio | numeric | 0 | |
|
| l1 | numeric | 0 | |
|
| l2 | numeric | 0 | |
|
| loss | character | Automatic | Automatic, Quantile, Quadratic, Absolute, Huber | - |
| max_categorical_features | integer | 2147483647 | |
|
| max_runtime_secs | numeric | 0 | |
|
| max_w2 | numeric | 3.402823e+38 | |
|
| mini_batch_size | integer | 1 | |
|
| missing_values_handling | character | MeanImputation | MeanImputation, Skip | - |
| momentum_ramp | numeric | 1e+06 | |
|
| momentum_stable | numeric | 0 | |
|
| momentum_start | numeric | 0 | |
|
| nesterov_accelerated_gradient | logical | TRUE | TRUE, FALSE | - |
| overwrite_with_best_model | logical | TRUE | TRUE, FALSE | - |
| pretrained_autoencoder | untyped | NULL | - | |
| quantile_alpha | numeric | 0.5 | |
|
| quiet_mode | logical | FALSE | TRUE, FALSE | - |
| rate | numeric | 0.005 | |
|
| rate_annealing | numeric | 1e-06 | |
|
| rate_decay | numeric | 1 | |
|
| regression_stop | numeric | 1e-06 | |
|
| replicate_training_data | logical | TRUE | TRUE, FALSE | - |
| reproducible | logical | FALSE | TRUE, FALSE | - |
| rho | numeric | 0.99 | |
|
| score_duty_cycle | numeric | 0.1 | |
|
| score_each_iteration | logical | FALSE | TRUE, FALSE | - |
| score_interval | numeric | 5 | |
|
| score_training_samples | integer | 10000 | |
|
| score_validation_samples | integer | 0 | |
|
| seed | integer | -1 | |
|
| shuffle_training_data | logical | FALSE | TRUE, FALSE | - |
| single_node_mode | logical | FALSE | TRUE, FALSE | - |
| sparse | logical | FALSE | TRUE, FALSE | - |
| sparsity_beta | numeric | 0 | |
|
| standardize | logical | TRUE | TRUE, FALSE | - |
| stopping_metric | character | AUTO | AUTO, deviance, MSE, RMSE, MAE, RMSLE | - |
| stopping_rounds | integer | 5 | |
|
| stopping_tolerance | numeric | 0 | |
|
| target_ratio_comm_to_comp | numeric | 0.05 | |
|
| train_samples_per_iteration | integer | -2 | |
|
| tweedie_power | numeric | 1.5 | |
|
| verbose | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrH2ODeeplearning
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrH2ODeeplearning$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrH2ODeeplearning$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Fryda T, LeDell E, Gill N, Aiello S, Fu A, Candel A, Click C, Kraljevic T, Nykodym T, Aboyoun P, Kurka M, Malohlava M, Poirier S, Wong W (2025). h2o: R Interface for the 'H2O' Scalable Machine Learning Platform. R package version 3.46.0.9, https://github.com/h2oai/h2o-3.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.h2o.deeplearning") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.h2o.deeplearning") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Gradient boosting machine learner.
Class h2o::h2o.gbm() from package h2o.
If no running H2O connection is found, the learner will automatically start a local H2O server
on 127.0.0.1 via h2o::h2o.init().
If you want to connect to a remote H2O cluster, call h2o::h2o.init() with the appropriate
arguments before training or predicting.
This Learner can be instantiated via lrn():
lrn("regr.h2o.gbm")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, h2o
| Id | Type | Default | Levels | Range |
| auto_rebalance | logical | TRUE | TRUE, FALSE | - |
| build_tree_one_node | logical | FALSE | TRUE, FALSE | - |
| categorical_encoding | character | AUTO | AUTO, Enum, OneHotInternal, OneHotExplicit, Binary, Eigen, LabelEncoder, SortByResponse, EnumLimited | - |
| check_constant_response | logical | TRUE | TRUE, FALSE | - |
| checkpoint | untyped | NULL | - | |
| col_sample_rate | numeric | 1 | |
|
| col_sample_rate_change_per_level | numeric | 1 | |
|
| col_sample_rate_per_tree | numeric | 1 | |
|
| custom_distribution_func | untyped | NULL | - | |
| distribution | character | gaussian | AUTO, poisson, laplace, tweedie, gaussian, huber, gamma, quantile, custom | - |
| export_checkpoints_dir | untyped | NULL | - | |
| histogram_type | character | AUTO | AUTO, UniformAdaptive, Random, QuantilesGlobal, RoundRobin, UniformRobust | - |
| huber_alpha | numeric | 0.9 | |
|
| ignore_const_cols | logical | TRUE | TRUE, FALSE | - |
| in_training_checkpoints_dir | untyped | NULL | - | |
| in_training_checkpoints_tree_interval | integer | 1 | |
|
| interaction_constraints | untyped | NULL | - | |
| learn_rate | numeric | 0.1 | |
|
| learn_rate_annealing | numeric | 1 | |
|
| max_abs_leafnode_pred | numeric | Inf | |
|
| max_depth | integer | 5 | |
|
| max_runtime_secs | numeric | 0 | |
|
| min_rows | integer | 10 | |
|
| min_split_improvement | numeric | 1e-05 | |
|
| monotone_constraints | untyped | NULL | - | |
| nbins | integer | 20 | |
|
| nbins_cats | integer | 1024 | |
|
| nbins_top_level | integer | 1024 | |
|
| ntrees | integer | 50 | |
|
| pred_noise_bandwidth | numeric | 0 | |
|
| quantile_alpha | numeric | 0.5 | |
|
| sample_rate | numeric | 1 | |
|
| score_each_iteration | logical | FALSE | TRUE, FALSE | - |
| score_tree_interval | integer | 0 | |
|
| seed | integer | -1 | |
|
| stopping_metric | character | AUTO | AUTO, deviance, MSE, RMSE, MAE, RMSLE | - |
| stopping_rounds | integer | 0 | |
|
| stopping_tolerance | numeric | 0.001 | |
|
| tweedie_power | numeric | 1.5 | |
|
| verbose | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrH2OGBM
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrH2OGBM$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrH2OGBM$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Fryda T, LeDell E, Gill N, Aiello S, Fu A, Candel A, Click C, Kraljevic T, Nykodym T, Aboyoun P, Kurka M, Malohlava M, Poirier S, Wong W (2025). h2o: R Interface for the 'H2O' Scalable Machine Learning Platform. R package version 3.46.0.9, https://github.com/h2oai/h2o-3.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.h2o.gbm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.h2o.gbm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Generalized linear model.
Calls h2o::h2o.glm() from package h2o.
If no running H2O connection is found, the learner will automatically start a local H2O server
on 127.0.0.1 via h2o::h2o.init().
If you want to connect to a remote H2O cluster, call h2o::h2o.init() with the appropriate
arguments before training or predicting.
This Learner can be instantiated via lrn():
lrn("regr.h2o.glm")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, h2o
| Id | Type | Default | Levels | Range |
| alpha | numeric | 0.5 | |
|
| beta_constraints | untyped | NULL | - | |
| beta_epsilon | numeric | 1e-04 | |
|
| build_null_model | logical | FALSE | TRUE, FALSE | - |
| calc_like | logical | FALSE | TRUE, FALSE | - |
| checkpoint | untyped | NULL | - | |
| cold_start | logical | FALSE | TRUE, FALSE | - |
| compute_p_values | logical | FALSE | TRUE, FALSE | - |
| early_stopping | logical | TRUE | TRUE, FALSE | - |
| export_checkpoints_dir | untyped | NULL | - | |
| generate_scoring_history | logical | FALSE | TRUE, FALSE | - |
| generate_variable_inflation_factors | logical | FALSE | TRUE, FALSE | - |
| gradient_epsilon | numeric | -1 | |
|
| HGLM | logical | FALSE | TRUE, FALSE | - |
| ignore_const_cols | logical | TRUE | TRUE, FALSE | - |
| interactions | untyped | NULL | - | |
| interaction_pairs | untyped | NULL | - | |
| intercept | logical | TRUE | TRUE, FALSE | - |
| lambda | numeric | 1e-05 | |
|
| lambda_min_ratio | numeric | -1 | |
|
| lambda_search | logical | FALSE | TRUE, FALSE | - |
| link | character | family_default | family_default, identity, log, inverse | - |
| max_active_predictors | integer | -1 | |
|
| max_iterations | integer | -1 | |
|
| max_runtime_secs | numeric | 0 | |
|
| missing_values_handling | character | MeanImputation | MeanImputation, Skip, PlugValues | - |
| nlambdas | integer | -1 | |
|
| non_negative | logical | FALSE | TRUE, FALSE | - |
| objective_epsilon | numeric | -1 | |
|
| obj_reg | numeric | -1 | |
|
| plug_values | untyped | NULL | - | |
| random_columns | untyped | NULL | - | |
| rand_family | untyped | NULL | - | |
| rand_link | untyped | NULL | - | |
| remove_collinear_columns | logical | FALSE | TRUE, FALSE | - |
| score_each_iteration | logical | FALSE | TRUE, FALSE | - |
| score_iteration_interval | integer | -1 | |
|
| seed | integer | -1 | |
|
| solver | character | AUTO | AUTO, IRLSM, L_BFGS, COORDINATE_DESCENT_NAIVE, COORDINATE_DESCENT, GRADIENT_DESCENT_LH, GRADIENT_DESCENT_SQERR | - |
| standardize | logical | TRUE | TRUE, FALSE | - |
| startval | untyped | NULL | - | |
| stopping_metric | character | AUTO | AUTO, deviance, MSE, RMSE, MAE, RMSLE | - |
| stopping_rounds | integer | 0 | |
|
| stopping_tolerance | numeric | 0.001 |
|
This learner calls h2o::h2o.glm() with family = "gaussian"
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrH2OGLM
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrH2OGLM$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrH2OGLM$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Fryda T, LeDell E, Gill N, Aiello S, Fu A, Candel A, Click C, Kraljevic T, Nykodym T, Aboyoun P, Kurka M, Malohlava M, Poirier S, Wong W (2025). h2o: R Interface for the 'H2O' Scalable Machine Learning Platform. R package version 3.46.0.9, https://github.com/h2oai/h2o-3.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.h2o.glm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.h2o.glm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Regression random forest learner.
Calls h2o::h2o.randomForest() from package h2o.
If no running H2O connection is found, the learner will automatically start a local H2O server
on 127.0.0.1 via h2o::h2o.init().
If you want to connect to a remote H2O cluster, call h2o::h2o.init() with the appropriate
arguments before training or predicting.
This Learner can be instantiated via lrn():
lrn("regr.h2o.randomForest")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, h2o
| Id | Type | Default | Levels | Range |
| build_tree_one_node | logical | FALSE | TRUE, FALSE | - |
| categorical_encoding | character | AUTO | AUTO, Enum, OneHotInternal, OneHotExplicit, Binary, Eigen, LabelEncoder, SortByResponse, EnumLimited | - |
| check_constant_response | logical | TRUE | TRUE, FALSE | - |
| checkpoint | untyped | NULL | - | |
| col_sample_rate_change_per_level | numeric | 1 | |
|
| col_sample_rate_per_tree | numeric | 1 | |
|
| export_checkpoints_dir | untyped | NULL | - | |
| histogram_type | character | AUTO | AUTO, UniformAdaptive, Random, QuantilesGlobal, RoundRobin, UniformRobust | - |
| ignore_const_cols | logical | TRUE | TRUE, FALSE | - |
| max_depth | integer | 20 | |
|
| max_runtime_secs | numeric | 0 | |
|
| min_rows | numeric | 1 | |
|
| min_split_improvement | numeric | 1e-05 | |
|
| mtries | integer | -1 | |
|
| nbins | integer | 20 | |
|
| nbins_cats | integer | 1024 | |
|
| nbins_top_level | integer | 1024 | |
|
| ntrees | integer | 50 | |
|
| sample_rate | numeric | 0.632 | |
|
| score_each_iteration | logical | FALSE | TRUE, FALSE | - |
| score_tree_interval | integer | 0 | |
|
| seed | integer | -1 | |
|
| stopping_metric | character | AUTO | AUTO, deviance, MSE, RMSE, MAE, RMSLE | - |
| stopping_rounds | integer | 0 | |
|
| stopping_tolerance | numeric | 0.001 | |
|
| verbose | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrH2ORandomForest
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrH2ORandomForest$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrH2ORandomForest$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Fryda T, LeDell E, Gill N, Aiello S, Fu A, Candel A, Click C, Kraljevic T, Nykodym T, Aboyoun P, Kurka M, Malohlava M, Poirier S, Wong W (2025). h2o: R Interface for the 'H2O' Scalable Machine Learning Platform. R package version 3.46.0.9, https://github.com/h2oai/h2o-3.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.h2o.randomForest") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.h2o.randomForest") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Instance based algorithm: K-nearest neighbours regression.
Calls RWeka::IBk() from RWeka.
This Learner can be instantiated via lrn():
lrn("regr.IBk")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, RWeka
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| weight | character | - | I, F | - |
| K | integer | 1 | |
|
| E | logical | FALSE | TRUE, FALSE | - |
| W | integer | 0 | |
|
| X | logical | FALSE | TRUE, FALSE | - |
| A | character | LinearNNSearch | BallTree, CoverTree, FilteredNeighbourSearch, KDTree, LinearNNSearch | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
weight:
original id: I and F
Reason for change: original I and F params are interdependent
(I can only be TRUE when F is FALSE and vice versa).
The easiest way to encode this is to combine I and F into one factor param.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrIBk
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrIBk$new()
marshal()
Marshal the learner's model.
LearnerRegrIBk$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrIBk$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrIBk$clone(deep = FALSE)
deepWhether to make a deep clone.
henrifnk
Aha, W D, Kibler, Dennis, Albert, K M (1991). “Instance-based learning algorithms.” Machine learning, 6(1), 37–66.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.IBk") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.IBk") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Instance-based regressor which differs from other instance-based learners in that
it uses an entropy-based distance function.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("regr.kstar")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| B | integer | 20 | |
|
| E | logical | - | TRUE, FALSE | - |
| M | character | a | a, d, m, n | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrKStar
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrKStar$new()
marshal()
Marshal the learner's model.
LearnerRegrKStar$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrKStar$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrKStar$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Cleary JG, Trigg LE (1995). “K*: An Instance-based Learner Using an Entropic Distance Measure.” In 12th International Conference on Machine Learning, 108-114.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.kstar") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.kstar") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Support Vector Regression.
Calls kernlab::ksvm() from kernlab.
This Learner can be instantiated via lrn():
lrn("regr.ksvm")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, kernlab
| Id | Type | Default | Levels | Range |
| scaled | logical | TRUE | TRUE, FALSE | - |
| type | character | eps-svr | eps-svr, nu-svr, eps-bsvr | - |
| kernel | character | rbfdot | rbfdot, polydot, vanilladot, laplacedot, besseldot, anovadot | - |
| C | numeric | 1 | |
|
| nu | numeric | 0.2 | |
|
| epsilon | numeric | 0.1 | |
|
| cache | integer | 40 | |
|
| tol | numeric | 0.001 | |
|
| shrinking | logical | TRUE | TRUE, FALSE | - |
| sigma | numeric | - | |
|
| degree | integer | - | |
|
| scale | numeric | - | |
|
| order | integer | - | |
|
| offset | numeric | - | |
|
| na.action | untyped | na.omit | - | |
| fit | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrKSVM
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrKSVM$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrKSVM$clone(deep = FALSE)
deepWhether to make a deep clone.
mboecker
Karatzoglou, Alexandros, Smola, Alex, Hornik, Kurt, Zeileis, Achim (2004). “kernlab-an S4 package for kernel methods in R.” Journal of statistical software, 11(9), 1–20.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.ksvm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.ksvm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Local approximate Gaussian process for regression.
Calls laGP::aGP() from laGP.
This Learner can be instantiated via lrn():
lrn("regr.laGP")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, laGP
| Id | Type | Default | Levels | Range |
| start | integer | 6 | |
|
| end | integer | 50 | |
|
| d | untyped | NULL | - | |
| g | untyped | 1/10000 | - | |
| method | character | alc | alc, alcray, efi, mspe, nn | - |
| close | integer | - | |
|
| numrays | integer | - | |
|
| verb | numeric | 0 |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrLaGP
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrLaGP$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrLaGP$clone(deep = FALSE)
deepWhether to make a deep clone.
Parameters start and end tune the initial and maximum neighborhood sizes
used for the local GP fit, d can fix the length-scale parameters, g
configures the nugget/regularization term, and method selects the search
heuristic (alc, alcray, efi, mspe, nn). Arguments close and
numrays further refine the ray-based search used by method = "alcray",
while verb controls the output verbosity.
awinterstetter
Gramacy, B. R (2016). “laGP: Large-Scale Spatial Modeling via Local Approximate Gaussian Processes in R.” Journal of Statistical Software, 72(1), 1–46. doi:10.18637/jss.v072.i01.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner (use a small neighborhood size for this task) learner = lrn("regr.laGP", end = 15) print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner (use a small neighborhood size for this task) learner = lrn("regr.laGP", end = 15) print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
L2 regularized support vector regression.
Calls LiblineaR::LiblineaR() from LiblineaR.
Type of SVR depends on type argument:
type = 11 - L2-regularized L2-loss support vector regression (primal)
type = 12 – L2-regularized L2-loss support vector regression (dual)
type = 13 – L2-regularized L1-loss support vector regression (dual)
This Learner can be instantiated via lrn():
lrn("regr.liblinear")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, LiblineaR
| Id | Type | Default | Levels | Range |
| type | integer | 11 | |
|
| cost | numeric | 1 | |
|
| bias | numeric | 1 | |
|
| svr_eps | numeric | NULL | |
|
| cross | integer | 0 | |
|
| verbose | logical | FALSE | TRUE, FALSE | - |
| findC | logical | FALSE | TRUE, FALSE | - |
| useInitC | logical | TRUE | TRUE, FALSE | - |
svr_eps:
Actual default: NULL
Initial value: 0.001
Reason for change: svr_eps is type dependent and the "type" is handled
by the mlr3learner. The default value is set to the default of the respective
"type".
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrLiblineaR
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrLiblineaR$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrLiblineaR$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Fan, Rong-En, Chang, Kai-Wei, Hsieh, Cho-Jui, Wang, Xiang-Rui, Lin, Chih-Jen (2008). “LIBLINEAR: A library for large linear classification.” the Journal of machine Learning research, 9, 1871–1874.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.liblinear") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.liblinear") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Gradient boosting algorithm.
Calls lightgbm::lightgbm() from lightgbm.
The list of parameters can be found here
and in the documentation of lightgbm::lgb.train().
This Learner can be instantiated via lrn():
lrn("regr.lightgbm")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, lightgbm
| Id | Type | Default | Levels | Range |
| objective | character | regression | regression, regression_l1, huber, fair, poisson, quantile, mape, gamma, tweedie | - |
| eval | untyped | - | - | |
| verbose | integer | 1 | |
|
| record | logical | TRUE | TRUE, FALSE | - |
| eval_freq | integer | 1 | |
|
| callbacks | untyped | - | - | |
| reset_data | logical | FALSE | TRUE, FALSE | - |
| boosting | character | gbdt | gbdt, rf, dart, goss | - |
| linear_tree | logical | FALSE | TRUE, FALSE | - |
| learning_rate | numeric | 0.1 | |
|
| num_leaves | integer | 31 | |
|
| tree_learner | character | serial | serial, feature, data, voting | - |
| num_threads | integer | 0 | |
|
| device_type | character | cpu | cpu, gpu | - |
| seed | integer | - | |
|
| deterministic | logical | FALSE | TRUE, FALSE | - |
| data_sample_strategy | character | bagging | bagging, goss | - |
| force_col_wise | logical | FALSE | TRUE, FALSE | - |
| force_row_wise | logical | FALSE | TRUE, FALSE | - |
| histogram_pool_size | integer | -1 | |
|
| max_depth | integer | -1 | |
|
| min_data_in_leaf | integer | 20 | |
|
| min_sum_hessian_in_leaf | numeric | 0.001 | |
|
| bagging_fraction | numeric | 1 | |
|
| bagging_freq | integer | 0 | |
|
| bagging_seed | integer | 3 | |
|
| bagging_by_query | logical | FALSE | TRUE, FALSE | - |
| feature_fraction | numeric | 1 | |
|
| feature_fraction_bynode | numeric | 1 | |
|
| feature_fraction_seed | integer | 2 | |
|
| extra_trees | logical | FALSE | TRUE, FALSE | - |
| extra_seed | integer | 6 | |
|
| max_delta_step | numeric | 0 | |
|
| lambda_l1 | numeric | 0 | |
|
| lambda_l2 | numeric | 0 | |
|
| linear_lambda | numeric | 0 | |
|
| min_gain_to_split | numeric | 0 | |
|
| drop_rate | numeric | 0.1 | |
|
| max_drop | integer | 50 | |
|
| skip_drop | numeric | 0.5 | |
|
| xgboost_dart_mode | logical | FALSE | TRUE, FALSE | - |
| uniform_drop | logical | FALSE | TRUE, FALSE | - |
| drop_seed | integer | 4 | |
|
| top_rate | numeric | 0.2 | |
|
| other_rate | numeric | 0.1 | |
|
| min_data_per_group | integer | 100 | |
|
| max_cat_threshold | integer | 32 | |
|
| cat_l2 | numeric | 10 | |
|
| cat_smooth | numeric | 10 | |
|
| max_cat_to_onehot | integer | 4 | |
|
| top_k | integer | 20 | |
|
| monotone_constraints | untyped | NULL | - | |
| monotone_constraints_method | character | basic | basic, intermediate, advanced | - |
| monotone_penalty | numeric | 0 | |
|
| feature_contri | untyped | NULL | - | |
| forcedsplits_filename | untyped | "" | - | |
| refit_decay_rate | numeric | 0.9 | |
|
| cegb_tradeoff | numeric | 1 | |
|
| cegb_penalty_split | numeric | 0 | |
|
| cegb_penalty_feature_lazy | untyped | - | - | |
| cegb_penalty_feature_coupled | untyped | - | - | |
| path_smooth | numeric | 0 | |
|
| interaction_constraints | untyped | - | - | |
| use_quantized_grad | logical | TRUE | TRUE, FALSE | - |
| num_grad_quant_bins | integer | 4 | |
|
| quant_train_renew_leaf | logical | FALSE | TRUE, FALSE | - |
| stochastic_rounding | logical | TRUE | TRUE, FALSE | - |
| serializable | logical | TRUE | TRUE, FALSE | - |
| max_bin | integer | 255 | |
|
| max_bin_by_feature | untyped | NULL | - | |
| min_data_in_bin | integer | 3 | |
|
| bin_construct_sample_cnt | integer | 200000 | |
|
| data_random_seed | integer | 1 | |
|
| is_enable_sparse | logical | TRUE | TRUE, FALSE | - |
| enable_bundle | logical | TRUE | TRUE, FALSE | - |
| use_missing | logical | TRUE | TRUE, FALSE | - |
| zero_as_missing | logical | FALSE | TRUE, FALSE | - |
| feature_pre_filter | logical | TRUE | TRUE, FALSE | - |
| pre_partition | logical | FALSE | TRUE, FALSE | - |
| two_round | logical | FALSE | TRUE, FALSE | - |
| forcedbins_filename | untyped | "" | - | |
| boost_from_average | logical | TRUE | TRUE, FALSE | - |
| reg_sqrt | logical | FALSE | TRUE, FALSE | - |
| alpha | numeric | 0.9 | |
|
| fair_c | numeric | 1 | |
|
| poisson_max_delta_step | numeric | 0.7 | |
|
| tweedie_variance_power | numeric | 1.5 | |
|
| metric_freq | integer | 1 | |
|
| num_machines | integer | 1 | |
|
| local_listen_port | integer | 12400 | |
|
| time_out | integer | 120 | |
|
| machines | untyped | "" | - | |
| gpu_platform_id | integer | -1 | |
|
| gpu_device_id | integer | -1 | |
|
| gpu_device_id_list | untyped | NULL | - | |
| gpu_use_dp | logical | FALSE | TRUE, FALSE | - |
| num_gpu | integer | 1 | |
|
| start_iteration_predict | integer | 0 | |
|
| num_iteration_predict | integer | -1 | |
|
| pred_early_stop | logical | FALSE | TRUE, FALSE | - |
| pred_early_stop_freq | integer | 10 | |
|
| pred_early_stop_margin | numeric | 10 | |
|
| num_iterations | integer | 100 | |
|
| early_stopping_rounds | integer | - | |
|
| early_stopping_min_delta | numeric | - | |
|
| first_metric_only | logical | FALSE | TRUE, FALSE | - |
num_threads:
Actual default: 0L
Initital value: 1L
Reason for change: Prevents accidental conflicts with future.
verbose:
Actual default: 1L
Initial value: -1L
Reason for change: Prevents accidental conflicts with mlr messaging system.
Early stopping can be used to find the optimal number of boosting rounds.
Set early_stopping_rounds to an integer value to monitor the performance of the model on the validation set while training.
For information on how to configure the validation set, see the Validation section of mlr3::Learner.
The internal validation measure can be set the eval parameter which should be a list of mlr3::Measures, functions, or strings for the internal lightgbm measures.
If first_metric_only = FALSE (default), the learner stops when any metric fails to improve.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrLightGBM
internal_valid_scoresThe last observation of the validation scores for all metrics.
Extracted from model$evaluation_log
internal_tuned_valuesReturns the early stopped iterations if early_stopping_rounds was set during training.
validateHow to construct the internal validation data.
This parameter can be either NULL, a ratio, "test", or "predefined".
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrLightGBM$new()
importance()
The importance scores are extracted from lbg.importance.
LearnerRegrLightGBM$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerRegrLightGBM$clone(deep = FALSE)
deepWhether to make a deep clone.
kapsner
Ke, Guolin, Meng, Qi, Finley, Thomas, Wang, Taifeng, Chen, Wei, Ma, Weidong, Ye, Qiwei, Liu, Tie-Yan (2017). “Lightgbm: A highly efficient gradient boosting decision tree.” Advances in neural information processing systems, 30.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.lightgbm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.lightgbm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Linear Regression learner that uses the Akaike criterion for model selection and
is able to deal with weighted instances.
Calls RWeka::LinearRegression() RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
additional_stats:
original id: additional-stats
use_qr:
original id: use-qr
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("regr.linear_regression")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| S | character | 0 | 0, 1, 2 | - |
| C | logical | FALSE | TRUE, FALSE | - |
| R | numeric | 1e-08 | |
|
| minimal | logical | FALSE | TRUE, FALSE | - |
| additional_stats | logical | FALSE | TRUE, FALSE | - |
| use_qr | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrLinearRegression
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrLinearRegression$new()
marshal()
Marshal the learner's model.
LearnerRegrLinearRegression$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrLinearRegression$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrLinearRegression$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.linear_regression") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.linear_regression") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Linear model with random effects.
Calls lme4::lmer() from lme4.
Although most mlr3 learners don't allow to specify the formula manually, and automatically
set it by valling task$formula(), this learner allows to set the formula because it's core
functionality depends it. This means that it might not always use all features that are available
in the task.
Be aware, that this can sometimes lead to unexpected error messages,
because mlr3 checks the compatibility between the learner and the task on all available features.
This Learner can be instantiated via lrn():
lrn("regr.lmer")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”
| Id | Type | Default | Levels | Range |
| formula | untyped | - | - | |
| REML | logical | TRUE | TRUE, FALSE | - |
| start | untyped | NULL | - | |
| verbose | integer | 0 | |
|
| contrasts | untyped | NULL | - | |
| optimizer | character | nloptwrap | Nelder_Mead, bobyqa, nlminbwrap, nloptwrap | - |
| restart_edge | logical | FALSE | TRUE, FALSE | - |
| boundary.tol | numeric | 1e-05 | |
|
| calc.derivs | logical | TRUE | TRUE, FALSE | - |
| autoscale | untyped | NULL | - | |
| check.nobs.vs.rankZ | character | ignore | ignore, warning, message, stop | - |
| check.nobs.vs.nlev | character | stop | ignore, warning, message, stop | - |
| check.nlev.gtreq.5 | character | ignore | ignore, warning, message, stop | - |
| check.nlev.gtr.1 | character | stop | ignore, warning, message, stop | - |
| check.nobs.vs.nRE | character | stop | ignore, warning, message, stop | - |
| check.rankX | character | message+drop.cols | message+drop.cols, silent.drop.cols, warn+drop.cols, stop.deficient, ignore | - |
| check.scaleX | character | warning | warning, stop, silent.rescale, message+rescale, warn+rescale, ignore | - |
| check.formula.LHS | character | stop | ignore, warning, message, stop | - |
| check.conv.nobsmax | numeric | 10000 | |
|
| check.conv.nparmax | numeric | 10 | |
|
| check.conv.grad | untyped | "lme4::.makeCC(\"warning\", tol = 2e-3, relTol = NULL)" | - | |
| check.conv.singular | untyped | "lme4::.makeCC(action = \"message\", tol = formals(lme4::isSingular)$tol)" | - | |
| check.conv.hess | untyped | "lme4::.makeCC(action = \"warning\", tol = 1e-6)" | - | |
| optCtrl | untyped | list() | - | |
| newparams | untyped | NULL | - | |
| re.form | untyped | NULL | - | |
| random.only | logical | FALSE | TRUE, FALSE | - |
| allow.new.levels | logical | FALSE | TRUE, FALSE | - |
| na.action | untyped | "stats::na.pass" | - |
If a Task contains a column with the offset role, it is automatically
incorporated during training via the offset argument in lme4::lmer().
No offset is applied during prediction for this learner.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrLmer
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrLmer$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrLmer$clone(deep = FALSE)
deepWhether to make a deep clone.
s-kganz
Bates, M D (2010). “lme4: Mixed-effects modeling with R.”
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner and set parameter values learner = lrn("regr.lmer", formula = mpg ~ (1 | gear)) # Define a Task task = tsk("mtcars") # Train the learner learner$train(task) print(learner$model)# Define the Learner and set parameter values learner = lrn("regr.lmer", formula = mpg ~ (1 | gear)) # Define a Task task = tsk("mtcars") # Train the learner learner$train(task) print(learner$model)
Implements base routines for generating M5 Model trees and rules.
Calls RWeka::M5P() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("regr.m5p")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| N | logical | - | TRUE, FALSE | - |
| U | logical | - | TRUE, FALSE | - |
| R | logical | - | TRUE, FALSE | - |
| M | integer | 4 | |
|
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| L | logical | - | TRUE, FALSE | - |
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrM5P
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrM5P$new()
marshal()
Marshal the learner's model.
LearnerRegrM5P$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrM5P$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrM5P$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Quinlan RJ (1992). “Learning with Continuous Classes.” In 5th Australian Joint Conference on Artificial Intelligence, 343-348.
Wang Y, Witten IH (1997). “Induction of model trees for predicting continuous classes.” In Poster papers of the 9th European Conference on Machine Learning.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.m5p") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.m5p") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Algorithm for inducing decision lists from
model trees.
Calls RWeka::M5Rules() from RWeka.
This Learner can be instantiated via lrn():
lrn("regr.M5Rules")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, RWeka
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| N | logical | FALSE | TRUE, FALSE | - |
| U | logical | FALSE | TRUE, FALSE | - |
| R | logical | FALSE | TRUE, FALSE | - |
| M | integer | 4 | |
|
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrM5Rules
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrM5Rules$new()
marshal()
Marshal the learner's model.
LearnerRegrM5Rules$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrM5Rules$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrM5Rules$clone(deep = FALSE)
deepWhether to make a deep clone.
henrifnk
Holmes, Geoffrey, Hall, Mark, Prank, Eibe (1999). “Generating rule sets from model trees.” In Australasian joint conference on artificial intelligence, 1–12. Springer.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.M5Rules") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.M5Rules") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Multivariate Adaptive Regression Splines.
Calls mda::mars() from mda.
This Learner can be instantiated via lrn():
lrn("regr.mars")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, mda
| Id | Type | Default | Levels | Range |
| degree | integer | 1 | |
|
| nk | integer | - | |
|
| penalty | numeric | 2 | |
|
| thresh | numeric | 0.001 | |
|
| prune | logical | TRUE | TRUE, FALSE | - |
| trace.mars | logical | FALSE | TRUE, FALSE | - |
| forward.step | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrMars
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrMars$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrMars$clone(deep = FALSE)
deepWhether to make a deep clone.
sumny
Friedman, H J (1991). “Multivariate adaptive regression splines.” The annals of statistics, 19(1), 1–67.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.mars") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.mars") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Model-based recursive partitioning algorithm.
Calls partykit::mob() from mob.
This Learner can be instantiated via lrn():
lrn("regr.mob")
Task type: “regr”
Predict Types: “response”, “se”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, partykit, sandwich, coin
| Id | Type | Default | Levels | Range |
| rhs | untyped | - | - | |
| fit | untyped | - | - | |
| offset | untyped | - | - | |
| cluster | untyped | - | - | |
| alpha | numeric | 0.05 | |
|
| bonferroni | logical | TRUE | TRUE, FALSE | - |
| minsize | integer | - | |
|
| minsplit | integer | - | |
|
| minbucket | integer | - | |
|
| maxdepth | integer | Inf | |
|
| mtry | integer | Inf | |
|
| trim | numeric | 0.1 | |
|
| breakties | logical | FALSE | TRUE, FALSE | - |
| parm | untyped | - | - | |
| dfsplit | integer | - | |
|
| prune | untyped | - | - | |
| restart | logical | TRUE | TRUE, FALSE | - |
| verbose | logical | FALSE | TRUE, FALSE | - |
| caseweights | logical | TRUE | TRUE, FALSE | - |
| ytype | character | vector | vector, matrix, data.frame | - |
| xtype | character | matrix | vector, matrix, data.frame | - |
| terminal | untyped | "object" | - | |
| inner | untyped | "object" | - | |
| model | logical | TRUE | TRUE, FALSE | - |
| numsplit | character | left | left, center | - |
| catsplit | character | binary | binary, multiway | - |
| vcov | character | opg | opg, info, sandwich | - |
| ordinal | character | chisq | chisq, max, L2 | - |
| nrep | integer | 10000 | |
|
| applyfun | untyped | - | - | |
| cores | integer | NULL | |
|
| additional | untyped | - | - | |
| predict_fun | untyped | - | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrMob
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrMob$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrMob$clone(deep = FALSE)
deepWhether to make a deep clone.
sumny
Hothorn T, Zeileis A (2015). “partykit: A Modular Toolkit for Recursive Partytioning in R.” Journal of Machine Learning Research, 16(118), 3905-3909. http://jmlr.org/papers/v16/hothorn15a.html.
Hothorn T, Hornik K, Zeileis A (2006). “Unbiased Recursive Partitioning: A Conditional Inference Framework.” Journal of Computational and Graphical Statistics, 15(3), 651–674. doi:10.1198/106186006x133933, https://doi.org/10.1198/106186006x133933.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
library(mlr3) lm_ = function(y, x, start = NULL, weights = NULL, offset = NULL, ...) { lm(y ~ 1, ...) } learner = LearnerRegrMob$new() learner$param_set$values$rhs = "." learner$param_set$values$fit = lm_ learner$feature_types = c("logical", "integer", "numeric", "factor", "ordered") predict_fun = function(object, newdata, task, .type) { preds = predict(object, newdata = newdata, type = "response", se.fit = TRUE) cbind(preds$fit, preds$se.fit) } learner$param_set$values$predict_fun = predict_fun task = tsk("mtcars") ids = partition(task) learner$train(task, row_ids = ids$train) learner$predict(task, row_ids = ids$test)library(mlr3) lm_ = function(y, x, start = NULL, weights = NULL, offset = NULL, ...) { lm(y ~ 1, ...) } learner = LearnerRegrMob$new() learner$param_set$values$rhs = "." learner$param_set$values$fit = lm_ learner$feature_types = c("logical", "integer", "numeric", "factor", "ordered") predict_fun = function(object, newdata, task, .type) { preds = predict(object, newdata = newdata, type = "response", se.fit = TRUE) cbind(preds$fit, preds$se.fit) } learner$param_set$values$predict_fun = predict_fun task = tsk("mtcars") ids = partition(task) learner$train(task, row_ids = ids$train) learner$predict(task, row_ids = ids$test)
Quantile Regression with generalized additive models for fitting a learner on multiple quantiles simultaneously.
Calls qgam::mqgam() from package qgam.
For the form parameter, a gam formula specific to the Task is required (see example and ?mgcv::formula.gam).
If no formula is provided, a fallback formula using all features in the task is used that will make the Learner behave like Linear Quantile Regression.
The features specified in the formula need to be the same as columns with col_roles "feature" in the task.
The quantiles for the Learner, i.e. qu parameter from qgam::mqgam(), is set using the values specified in learner$quantiles.
The response quantile can be specified using learner$quantile_response.
This Learner can be instantiated via lrn():
lrn("regr.mqgam")
Task type: “regr”
Predict Types: “response”, “se”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”, “factor”
| Id | Type | Default | Levels | Range |
| form | untyped | - | - | |
| lsig | numeric | - | |
|
| err | numeric | - | |
|
| cluster | untyped | NULL | - | |
| multicore | logical | - | TRUE, FALSE | - |
| ncores | numeric | - | |
|
| paropts | untyped | list() | - | |
| link | untyped | "identity" | - | |
| argGam | untyped | - | - | |
| discrete | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrMQGam
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrMQGam$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrMQGam$clone(deep = FALSE)
deepWhether to make a deep clone.
lona-k
Fasiolo, Matteo, Wood, N. S, Zaffran, Margaux, Nedellec, Raphael, Goude, Yannig (2017). “Fast Calibrated Additive Quantile Regression.” Journal of the American Statistical Association, 116, 1402–1412. doi:10.1080/01621459.2020.1725521.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Regressor that uses backpropagation to learn a multi-layer perceptron.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
G removed:
GUI will be opened
Reason for change: The parameter is removed because we don't want to launch GUI.
This Learner can be instantiated via lrn():
lrn("regr.multilayer_perceptron")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| L | numeric | 0.3 | |
|
| M | numeric | 0.2 | |
|
| N | integer | 500 | |
|
| V | numeric | 0 | |
|
| S | integer | 0 | |
|
| E | integer | 20 | |
|
| A | logical | FALSE | TRUE, FALSE | - |
| B | logical | FALSE | TRUE, FALSE | - |
| H | untyped | "a" | - | |
| C | logical | FALSE | TRUE, FALSE | - |
| I | logical | FALSE | TRUE, FALSE | - |
| R | logical | FALSE | TRUE, FALSE | - |
| D | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrMultilayerPerceptron
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrMultilayerPerceptron$new()
marshal()
Marshal the learner's model.
LearnerRegrMultilayerPerceptron$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrMultilayerPerceptron$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrMultilayerPerceptron$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.multilayer_perceptron") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.multilayer_perceptron") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Principal Component Regression model.
Calls pls::pcr() from pls.
model
Actual default: TRUE
Adjusted default: FALSE
Reason for change: keeps model objects compact because predictions do not require the stored model frame.
This Learner can be instantiated via lrn():
lrn("regr.pcr")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, pls
| Id | Type | Default | Levels | Range |
| ncomp | integer | - | |
|
| method | character | cppls | kernelpls, widekernelpls, simpls, oscorespls, cppls, svdpc | - |
| scale | logical | FALSE | TRUE, FALSE | - |
| model | logical | - | TRUE, FALSE | - |
| x | logical | FALSE | TRUE, FALSE | - |
| y | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrPcr
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrPcr$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrPcr$clone(deep = FALSE)
deepWhether to make a deep clone.
During prediction, all components ncomp used in training are used.
awinterstetter
Jolliffe, T. I (1982). “A note on the use of principal components in regression.” Journal of the Royal Statistical Society. Series C (Applied Statistics), 31(3), 300–303.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.pcr") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.pcr") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Penalized (L1 and L2) Logistic Regression.
Calls penalized::penalized() from: penalized.
The penalized and unpenalized arguments in the learner are implemented slightly
differently than in penalized::penalized(). Here, there is no parameter for penalized but
instead it is assumed that every variable is penalized unless stated in the unpenalized
parameter.
trace is set to "FALSE" to disable printing output during model training.
This Learner can be instantiated via lrn():
lrn("regr.penalized")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| epsilon | numeric | 1e-10 | |
|
| fusedl | logical | FALSE | TRUE, FALSE | - |
| lambda1 | numeric | 0 | |
|
| lambda2 | numeric | 0 | |
|
| maxiter | integer | - | |
|
| model | character | linear | linear, poisson | - |
| positive | untyped | FALSE | - | |
| standardize | logical | FALSE | TRUE, FALSE | - |
| startbeta | untyped | - | - | |
| startgamma | untyped | - | - | |
| steps | untyped | 1L | - | |
| trace | logical | TRUE | TRUE, FALSE | - |
| unpenalized | untyped | - | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrPenalized
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrPenalized$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrPenalized$clone(deep = FALSE)
deepWhether to make a deep clone.
annanzrv
Goeman, J J (2010). “L1 penalized estimation in the Cox proportional hazards model.” Biometrical journal, 52(1), 70–84.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.penalized") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.penalized") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Partial least squares regression.
Calls pls::plsr() from pls.
This Learner can be instantiated via lrn():
lrn("regr.plsr")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”
| Id | Type | Default | Levels | Range |
| ncomp | integer | - | |
|
| method | character | kernelpls | kernelpls, widekernelpls, simpls, oscorespls | - |
| scale | logical | TRUE | TRUE, FALSE | - |
| center | logical | TRUE | TRUE, FALSE | - |
| validation | character | none | none, CV, LOO | - |
| model | logical | TRUE | TRUE, FALSE | - |
| x | logical | FALSE | TRUE, FALSE | - |
| y | logical | FALSE | TRUE, FALSE | - |
| orthScores | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrPlsr
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrPlsr$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrPlsr$clone(deep = FALSE)
deepWhether to make a deep clone.
During prediction, all components ncomp used in training are used.
awinterstetter
Mevik, Bjorn-Helge, Wehrens, Ron (2007). “The pls Package: Principal Component and Partial Least Squares Regression in R.” Journal of Statistical Software, 18(2), 1–24. doi:10.18637/jss.v018.i02.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.plsr") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.plsr") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Polynomial regression.
Calls polyreg::polyFit() from polyreg.
deg: We have set this to 2, pretty arbitrarily.
noisy: We have set this to FALSE, to get no output on the console.
This Learner can be instantiated via lrn():
lrn("regr.polyFit")
Task type: “regr”
Predict Types: “response”
Feature Types: “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, polyreg
| Id | Type | Default | Levels | Range |
| deg | integer | - | |
|
| maxInteractDeg | integer | - | |
|
| return_xy | logical | FALSE | TRUE, FALSE | - |
| returnPoly | logical | FALSE | TRUE, FALSE | - |
| noisy | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrPolyFit
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrPoly$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrPoly$clone(deep = FALSE)
deepWhether to make a deep clone.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Patient outcome prediction based on multi-omics data taking practitioners’ preferences into account.
Calls prioritylasso::prioritylasso() from prioritylasso.
family is set to "gaussian" and cannot be changed
type.measure set to "mse" (cross-validation measure)
This Learner can be instantiated via lrn():
lrn("regr.priority_lasso")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, prioritylasso
| Id | Type | Default | Levels | Range |
| blocks | untyped | - | - | |
| max.coef | untyped | NULL | - | |
| block1.penalization | logical | TRUE | TRUE, FALSE | - |
| lambda.type | character | lambda.min | lambda.min, lambda.1se | - |
| standardize | logical | TRUE | TRUE, FALSE | - |
| nfolds | integer | 5 | |
|
| foldid | untyped | NULL | - | |
| cvoffset | logical | FALSE | TRUE, FALSE | - |
| cvoffsetnfolds | integer | 10 | |
|
| handle.missingtestdata | character | - | none, omit.prediction, set.zero, impute.block | - |
| include.allintercepts | logical | FALSE | TRUE, FALSE | - |
| use.blocks | untyped | "all" | - | |
| alignment | character | lambda | lambda, fraction | - |
| alpha | numeric | 1 | |
|
| big | numeric | 9.9e+35 | |
|
| devmax | numeric | 0.999 | |
|
| dfmax | integer | - | |
|
| eps | numeric | 1e-06 | |
|
| epsnr | numeric | 1e-08 | |
|
| exclude | untyped | - | - | |
| exmx | numeric | 250 | |
|
| fdev | numeric | 1e-05 | |
|
| gamma | untyped | - | - | |
| grouped | logical | TRUE | TRUE, FALSE | - |
| intercept | logical | TRUE | TRUE, FALSE | - |
| keep | logical | FALSE | TRUE, FALSE | - |
| lambda | untyped | - | - | |
| lambda.min.ratio | numeric | - | |
|
| lower.limits | untyped | -Inf | - | |
| maxit | integer | 100000 | |
|
| mnlam | integer | 5 | |
|
| mxit | integer | 100 | |
|
| mxitnr | integer | 25 | |
|
| nlambda | integer | 100 | |
|
| offset | untyped | NULL | - | |
| parallel | logical | FALSE | TRUE, FALSE | - |
| penalty.factor | untyped | - | - | |
| pmax | integer | - | |
|
| pmin | numeric | 1e-09 | |
|
| prec | numeric | 1e-10 | |
|
| standardize.response | logical | FALSE | TRUE, FALSE | - |
| thresh | numeric | 1e-07 | |
|
| trace.it | integer | 0 | |
|
| type.gaussian | character | - | covariance, naive | - |
| type.logistic | character | Newton | Newton, modified.Newton | - |
| type.multinomial | character | ungrouped | ungrouped, grouped | - |
| upper.limits | untyped | Inf | - | |
| scale.y | logical | FALSE | TRUE, FALSE | - |
| return.x | logical | TRUE | TRUE, FALSE | - |
| predict.gamma | numeric | gamma.1se | |
|
| relax | logical | FALSE | TRUE, FALSE | - |
| s | numeric | lambda.1se |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrPriorityLasso
new()
Creates a new instance of this R6 class.
LearnerRegrPriorityLasso$new()
selected_features()
Selected features when coef is positive
LearnerRegrPriorityLasso$selected_features()
character().
clone()
The objects of this class are cloneable with this method.
LearnerRegrPriorityLasso$clone(deep = FALSE)
deepWhether to make a deep clone.
HarutyunyanLiana
Simon K, Vindi J, Roman H, Tobias H, Anne-Laure B (2018). “Priority-Lasso: a simple hierarchical approach to the prediction of clinical outcome using multi-omics data.” BMC Bioinformatics, 19. doi:10.1186/s12859-018-2344-6.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner and set parameter values learner = lrn("regr.priority_lasso", blocks = list(bp1 = 1:4, bp2 = 5:9, bp3 = 10:28, bp4 = 29:1028)) print(learner) # Define a Task task = mlr3::as_task_regr(prioritylasso::pl_data, target = "pl_out") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # print the model print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner and set parameter values learner = lrn("regr.priority_lasso", blocks = list(bp1 = 1:4, bp2 = 5:9, bp3 = 10:28, bp4 = 29:1028)) print(learner) # Define a Task task = mlr3::as_task_regr(prioritylasso::pl_data, target = "pl_out") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # print the model print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Quantile Regression with generalized additive models.
Calls qgam::qgam() from package qgam.
For the form parameter, a gam formula specific to the Task is required (see example and ?mgcv::formula.gam).
If no formula is provided, a fallback formula using all features in the task is used that will make the Learner behave like Linear Quantile Regression.
The features specified in the formula need to be the same as columns with col_roles "feature" in the task.
The quantile for the Learner, i.e. qu parameter from qgam::qgam(), is set using the value specified in learner$quantiles.
This Learner can be instantiated via lrn():
lrn("regr.qgam")
Task type: “regr”
Predict Types: “response”, “se”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”, “factor”
| Id | Type | Default | Levels | Range |
| form | untyped | - | - | |
| lsig | numeric | - | |
|
| err | numeric | - | |
|
| cluster | untyped | NULL | - | |
| multicore | logical | - | TRUE, FALSE | - |
| ncores | numeric | - | |
|
| paropts | untyped | list() | - | |
| link | untyped | "identity" | - | |
| argGam | untyped | - | - | |
| discrete | logical | FALSE | TRUE, FALSE | - |
| block.size | integer | 1000 | |
|
| unconditional | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrQGam
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrQGam$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrQGam$clone(deep = FALSE)
deepWhether to make a deep clone.
lona-k
Fasiolo, Matteo, Wood, N. S, Zaffran, Margaux, Nedellec, Raphael, Goude, Yannig (2017). “Fast Calibrated Additive Quantile Regression.” Journal of the American Statistical Association, 116, 1402–1412. doi:10.1080/01621459.2020.1725521.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Class for constructing a forest of random trees.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
store_out_of_bag_predictions:
original id: store-out-of-bag-predictions
output_out_of_bag_complexity_statistics:
original id: output-out-of-bag-complexity-statistics
num_slots:
original id: num-slots
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
attribute-importance removed:
Compute and output attribute importance (mean impurity decrease method)
Reason for change: The parameter is removed because it's unclear how to actually use it.
This Learner can be instantiated via lrn():
lrn("regr.random_forest_weka")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| P | numeric | 100 | |
|
| O | logical | FALSE | TRUE, FALSE | - |
| store_out_of_bag_predictions | logical | FALSE | TRUE, FALSE | - |
| output_out_of_bag_complexity_statistics | logical | FALSE | TRUE, FALSE | - |
| logical | FALSE | TRUE, FALSE | - | |
| I | integer | 100 | |
|
| num_slots | integer | 1 | |
|
| K | integer | 0 | |
|
| M | integer | 1 | |
|
| V | numeric | 0.001 | |
|
| S | integer | 1 | |
|
| depth | integer | 0 | |
|
| N | integer | 0 | |
|
| U | logical | FALSE | TRUE, FALSE | - |
| B | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrRandomForestWeka
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrRandomForestWeka$new()
marshal()
Marshal the learner's model.
LearnerRegrRandomForestWeka$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrRandomForestWeka$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrRandomForestWeka$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Breiman, Leo (2001). “Random Forests.” Machine Learning, 45(1), 5–32. ISSN 1573-0565, doi:10.1023/A:1010933404324.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.random_forest_weka") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.random_forest_weka") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Tree that considers K randomly chosen attributes at each node.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("regr.random_tree")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| K | integer | 0 | |
|
| M | integer | 1 | |
|
| V | numeric | 0.001 | |
|
| S | integer | 1 | |
|
| depth | integer | 0 | |
|
| N | integer | 0 | |
|
| U | logical | FALSE | TRUE, FALSE | - |
| B | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrRandomTree
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrRandomTree$new()
marshal()
Marshal the learner's model.
LearnerRegrRandomTree$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrRandomTree$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrRandomTree$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.random_tree") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.random_tree") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Random forest for regression.
Calls randomForest::randomForest() from randomForest.
This Learner can be instantiated via lrn():
lrn("regr.randomForest")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, randomForest
| Id | Type | Default | Levels | Range |
| ntree | integer | 500 | |
|
| mtry | integer | - | |
|
| replace | logical | TRUE | TRUE, FALSE | - |
| strata | untyped | - | - | |
| sampsize | untyped | - | - | |
| nodesize | integer | 5 | |
|
| maxnodes | integer | - | |
|
| importance | character | FALSE | mse, nudepurity, none | - |
| localImp | logical | FALSE | TRUE, FALSE | - |
| proximity | logical | FALSE | TRUE, FALSE | - |
| oob.prox | logical | - | TRUE, FALSE | - |
| norm.votes | logical | TRUE | TRUE, FALSE | - |
| do.trace | logical | FALSE | TRUE, FALSE | - |
| keep.forest | logical | TRUE | TRUE, FALSE | - |
| keep.inbag | logical | FALSE | TRUE, FALSE | - |
| predict.all | logical | FALSE | TRUE, FALSE | - |
| nodes | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrRandomForest
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrRandomForest$new()
importance()
The importance scores are extracted from the slot importance.
Parameter 'importance' must be set to either "mse" or "nodepurity".
LearnerRegrRandomForest$importance()
Named numeric().
oob_error()
OOB errors are extracted from the model slot mse.
LearnerRegrRandomForest$oob_error()
numeric(1).
clone()
The objects of this class are cloneable with this method.
LearnerRegrRandomForest$clone(deep = FALSE)
deepWhether to make a deep clone.
pat-s
Breiman, Leo (2001). “Random Forests.” Machine Learning, 45(1), 5–32. ISSN 1573-0565, doi:10.1023/A:1010933404324.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.randomForest", importance = "mse") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.randomForest", importance = "mse") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Fast decision tree learner.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("regr.reptree")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| M | integer | 2 | |
|
| V | numeric | 0.001 | |
|
| N | integer | 3 | |
|
| S | integer | 1 | |
|
| P | logical | - | TRUE, FALSE | - |
| L | integer | -1 | |
|
| I | integer | 0 | |
|
| R | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrREPTree
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrREPTree$new()
marshal()
Marshal the learner's model.
LearnerRegrREPTree$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrREPTree$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrREPTree$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.reptree") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.reptree") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Random forest for regression.
Calls randomForestSRC::rfsrc() from randomForestSRC.
This Learner can be instantiated via lrn():
lrn("regr.rfsrc")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, randomForestSRC
| Id | Type | Default | Levels | Range |
| ntree | integer | 500 | |
|
| mtry | integer | - | |
|
| mtry.ratio | numeric | - | |
|
| nodesize | integer | 15 | |
|
| nodedepth | integer | - | |
|
| splitrule | character | mse | mse, quantile.regr, la.quantile.regr | - |
| nsplit | integer | 10 | |
|
| importance | character | FALSE | FALSE, TRUE, none, permute, random, anti | - |
| block.size | integer | 10 | |
|
| bootstrap | character | by.root | by.root, by.node, none, by.user | - |
| samptype | character | swor | swor, swr | - |
| samp | untyped | - | - | |
| membership | logical | FALSE | TRUE, FALSE | - |
| sampsize | untyped | - | - | |
| sampsize.ratio | numeric | - | |
|
| na.action | character | na.omit | na.omit, na.impute | - |
| nimpute | integer | 1 | |
|
| proximity | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| distance | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| forest.wt | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| xvar.wt | untyped | - | - | |
| split.wt | untyped | - | - | |
| forest | logical | TRUE | TRUE, FALSE | - |
| var.used | character | FALSE | FALSE, all.trees | - |
| split.depth | character | FALSE | FALSE, all.trees, by.tree | - |
| seed | integer | - | |
|
| do.trace | logical | FALSE | TRUE, FALSE | - |
| get.tree | untyped | - | - | |
| outcome | character | train | train, test | - |
| ptn.count | integer | 0 | |
|
| cores | integer | 1 | |
|
| save.memory | logical | FALSE | TRUE, FALSE | - |
| perf.type | character | - | none | - |
| case.depth | logical | FALSE | TRUE, FALSE | - |
| marginal.xvar | untyped | NULL | - |
mtry: This hyperparameter can alternatively be set via the added
hyperparameter mtry.ratio as mtry = max(ceiling(mtry.ratio * n_features), 1).
Note that mtry and mtry.ratio are mutually exclusive.
sampsize: This hyperparameter can alternatively be set via the added
hyperparameter sampsize.ratio as sampsize = max(ceiling(sampsize.ratio * n_obs), 1).
Note that sampsize and sampsize.ratio are mutually exclusive.
cores: This value is set as the option rf.cores during training and is
set to 1 by default.
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrRandomForestSRC
new()
Creates a new instance of this R6 class.
LearnerRegrRandomForestSRC$new()
importance()
The importance scores are extracted from the model slot importance.
LearnerRegrRandomForestSRC$importance()
Named numeric().
selected_features()
Selected features are extracted from the model slot var.used.
Note: Due to a known issue in randomForestSRC, enabling var.used = "all.trees"
causes prediction to fail. Therefore, this setting should be used exclusively
for feature selection purposes and not when prediction is required.
LearnerRegrRandomForestSRC$selected_features()
character().
oob_error()
OOB error extracted from the model slot err.rate.
LearnerRegrRandomForestSRC$oob_error()
numeric().
clone()
The objects of this class are cloneable with this method.
LearnerRegrRandomForestSRC$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Breiman, Leo (2001). “Random Forests.” Machine Learning, 45(1), 5–32. ISSN 1573-0565, doi:10.1023/A:1010933404324.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.rfsrc", importance = "TRUE") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.rfsrc", importance = "TRUE") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Regularized random forest for regression.
Calls RRF::RRF() from RRF.
This Learner can be instantiated via lrn():
lrn("regr.RRF")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3extralearners, RRF
| Id | Type | Default | Levels | Range |
| ntree | integer | 500 | |
|
| mtry | integer | - | |
|
| nodesize | integer | - | |
|
| replace | logical | TRUE | TRUE, FALSE | - |
| flagReg | integer | 1 | |
|
| coefReg | numeric | 0.8 | |
|
| feaIni | untyped | - | - | |
| corr.bias | logical | FALSE | TRUE, FALSE | - |
| maxnodes | integer | - | |
|
| importance | logical | FALSE | TRUE, FALSE | - |
| localImp | logical | FALSE | TRUE, FALSE | - |
| nPerm | integer | 1 | |
|
| proximity | logical | FALSE | TRUE, FALSE | - |
| oob.prox | logical | FALSE | TRUE, FALSE | - |
| do.trace | logical | FALSE | TRUE, FALSE | - |
| keep.inbag | logical | FALSE | TRUE, FALSE | - |
| keep.forest | logical | TRUE | TRUE, FALSE | - |
| strata | untyped | - | - | |
| sampsize | untyped | - | - | |
| predict.all | logical | FALSE | TRUE, FALSE | - |
| nodes | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrRRF
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrRRF$new()
importance()
The importance scores are extracted from the slot importance.
LearnerRegrRRF$importance()
Named numeric().
oob_error()
OOB errors are extracted from the model slot mse.
LearnerRegrRRF$oob_error()
numeric(1).
clone()
The objects of this class are cloneable with this method.
LearnerRegrRRF$clone(deep = FALSE)
deepWhether to make a deep clone.
awinterstetter
Deng, Houtao, Runger, George (2012). “Feature selection via regularized trees.” In 2012 International Joint Conference on Neural Networks (IJCNN), 1–8. IEEE. doi:10.1109/IJCNN.2012.6252640.
Deng, Houtao, Runger, George (2013). “Gene selection with guided regularized random forest.” Pattern Recognition, 46(12), 3483–3489. doi:10.1016/j.patcog.2013.05.021.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.RRF") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.RRF") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Fit a linear model with a response-surface component.
Calls rsm::rsm() from rsm.
modelfun: This parameter controls how the formula for rsm::rsm() is created. Possible values are:
"FO" - first order
"TWI" - wo-way interactions, this is with 1st oder terms
"SO" - full second order
This Learner can be instantiated via lrn():
lrn("regr.rsm")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels |
| modelfun | character | - | FO, TWI, SO |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrRSM
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrRSM$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrRSM$clone(deep = FALSE)
deepWhether to make a deep clone.
sebffischer
Lenth, V R (2010). “Response-surface methods in R, using rsm.” Journal of Statistical Software, 32, 1–17.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.rsm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.rsm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Bayesian version of the support vector machine.
Parameters sigma, degree, scale, offset, order, length,
lambda, and normalized are added to make tuning kpar easier.
If kpar is provided then these new parameters are ignored. If none are
provided then the default "automatic" is used for kpar.
Calls kernlab::rvm() from package kernlab.
This Learner can be instantiated via lrn():
lrn("regr.rvm")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, mlr3extralearners, kernlab
| Id | Type | Default | Levels | Range |
| kernel | character | rbfdot | rbfdot, polydot, vanilladot, tanhdot, laplacedot, besseldot, anovadot, splinedot, stringdot | - |
| sigma | numeric | - | |
|
| degree | numeric | - | |
|
| scale | numeric | - | |
|
| offset | numeric | - | |
|
| order | numeric | - | |
|
| length | integer | - | |
|
| lambda | numeric | - | |
|
| normalized | logical | - | TRUE, FALSE | - |
| kpar | untyped | "automatic" | - | |
| alpha | untyped | 5 | - | |
| var | numeric | 0.1 | |
|
| var.fix | logical | FALSE | TRUE, FALSE | - |
| iterations | integer | 100 | |
|
| tol | numeric | 2.220446e-16 | |
|
| minmaxdiff | numeric | 0.001 | |
|
| verbosity | logical | FALSE | TRUE, FALSE | - |
| fit | logical | TRUE | TRUE, FALSE | - |
| na.action | untyped | na.omit | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrRVM
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrRVM$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrRVM$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Karatzoglou, Alexandros, Smola, Alex, Hornik, Kurt, Zeileis, Achim (2004). “kernlab-an S4 package for kernel methods in R.” Journal of statistical software, 11(9), 1–20.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.rvm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.rvm") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Stochastic Gradient Descent for learning various linear models.
Calls RWeka::make_Weka_classifier() from RWeka.
F:
Has only 3 out of 5 original loss functions: 2 = squared loss (regression), 3 = epsilon insensitive loss (regression) and 4 = Huber loss (regression) with 2 (squared loss) being the new default
Reason for change: this learner should only contain loss functions appropriate for regression tasks
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("regr.sgd")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| F | character | 2 | 2, 3, 4 | - |
| L | numeric | 0.01 | |
|
| R | numeric | 1e-04 | |
|
| E | integer | 500 | |
|
| C | numeric | 0.001 | |
|
| N | logical | - | TRUE, FALSE | - |
| M | logical | - | TRUE, FALSE | - |
| S | integer | 1 | |
|
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrSGD
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrSGD$new()
marshal()
Marshal the learner's model.
LearnerRegrSGD$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrSGD$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrSGD$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.sgd") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.sgd") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Simple linear regression model that picks the attribute that results in the lowest squared error.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
additional_stats:
original id: additional-stats
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("regr.simple_linear_regression")
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| additional_stats | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrSimpleLinearRegression
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrSimpleLinearRegression$new()
marshal()
Marshal the learner's model.
LearnerRegrSimpleLinearRegression$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrSimpleLinearRegression$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrSimpleLinearRegression$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.simple_linear_regression") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.simple_linear_regression") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Support Vector Machine for regression.
Calls RWeka::make_Weka_classifier() from RWeka.
output_debug_info:
original id: output-debug-info
do_not_check_capabilities:
original id: do-not-check-capabilities
num_decimal_places:
original id: num-decimal-places
batch_size:
original id: batch-size
T_improved:
original id: T
V_improved:
original id: V
P_improved:
original id: P
L_improved:
original id: L (duplicated L for when I is set to RegSMOImproved)
W_improved:
original id: W
C_poly:
original id: C
E_poly:
original id: E
L_poly:
original id: L (duplicated L for when K is set to PolyKernel)
Reason for change: This learner contains changed ids of the following control arguments since their ids contain irregular pattern
This Learner can be instantiated via lrn():
lrn("regr.smo_reg")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
| Id | Type | Default | Levels | Range |
| subset | untyped | - | - | |
| na.action | untyped | - | - | |
| C | numeric | 1 | |
|
| N | character | 0 | 0, 1, 2 | - |
| I | character | RegSMOImproved | RegSMO, RegSMOImproved | - |
| K | character | PolyKernel | NormalizedPolyKernel, PolyKernel, Puk, RBFKernel, StringKernel | - |
| T_improved | numeric | 0.001 | |
|
| V_improved | logical | TRUE | TRUE, FALSE | - |
| P_improved | numeric | 1e-12 | |
|
| L_improved | numeric | 0.001 | |
|
| W_improved | integer | 1 | |
|
| C_poly | integer | 250007 | |
|
| E_poly | numeric | 1 | |
|
| L_poly | logical | FALSE | TRUE, FALSE | - |
| output_debug_info | logical | FALSE | TRUE, FALSE | - |
| do_not_check_capabilities | logical | FALSE | TRUE, FALSE | - |
| num_decimal_places | integer | 2 | |
|
| batch_size | integer | 100 | |
|
| options | untyped | NULL | - |
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrSMOreg
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrSMOreg$new()
marshal()
Marshal the learner's model.
LearnerRegrSMOreg$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrSMOreg$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrSMOreg$clone(deep = FALSE)
deepWhether to make a deep clone.
damirpolat
Shevade S, Keerthi S, Bhattacharyya C, Murthy K (1999). “Improvements to the SMO Algorithm for SVM Regression.” In IEEE Transactions on Neural Networks.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("regr.smo_reg") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("regr.smo_reg") print(learner) # Define a Task task = tsk("mtcars") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Foundation model for tabular data.
Uses reticulate to interface with the tabpfn Python package.
This learner relies on reticulate to handle Python dependencies.
It is not necessary to install any Python package manually in advance or specify a Python environment
via reticulate::use_python(), reticulate::use_virtualenv(), reticulate::use_condaenv(),
or reticulate::use_miniconda().
By calling $train() or $predict(), the required Python packages (tapfn, torch, etc.) will be installed
automatically, if not already.
Reticulate will then configure and initialize an ephemeral environment satisfying those requirements,
unless an existing environment (e.g., "r-reticulate") in reticulate's
Order of Discovery
contains all the necessary packages.
You may also manually install tabpfn into a Python environment following the
official installation guide
and specify the environment via reticulate::use_*() before calling $train() or $predict().
Note that the GPU version of PyTorch cannot be loaded by reticulate::use_condaenv() from a conda environment.
To use a conda environment, please install the CPU version of PyTorch.
In order to save a LearnerRegrTabPFN for later usage,
it is necessary to call the $marshal() method on the Learner
before writing it to disk, as the object will otherwise not be saved correctly.
After loading a marshaled LearnerRegrTabPFN into R again,
you then need to call $unmarshal() to transform it into a useable state.
n_jobs is initialized to 1 to avoid threading conflicts with future.
output_type corresponds to the same argument of the .predict() method of the TabPFNRegressor class,
but only supports the options "mean", "median" and "mode".
The point predictions are stored as $response of the prediction object.
categorical_feature_indices uses R indexing instead of zero-based Python indexing.
device must be a string.
If set to "auto", the behavior is the same as original.
Otherwise, the string is passed as argument to torch.device() to create a device.
inference_precision must be "auto", "autocast",
or a torch.dtype string,
e.g., "torch.float32", "torch.float64", etc.
Non-float dtypes are not supported.
inference_config is currently not supported.
random_state accepts either an integer or the special value "None"
which corresponds to None in Python.
Following the original Python implementation, the default random_state is 0.
This Learner can be instantiated via lrn():
lrn("regr.tabpfn")
Task type: “regr”
Predict Types: “response”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, reticulate
| Id | Type | Default | Levels | Range |
| output_type | character | mean | mean, median, mode | - |
| n_estimators | integer | 4 | |
|
| categorical_features_indices | untyped | - | - | |
| softmax_temperature | numeric | 0.9 | |
|
| average_before_softmax | logical | FALSE | TRUE, FALSE | - |
| model_path | untyped | "auto" | - | |
| device | untyped | "auto" | - | |
| ignore_pretraining_limits | logical | FALSE | TRUE, FALSE | - |
| inference_precision | character | auto | auto, autocast, torch.float32, torch.float, torch.float64, torch.double, torch.float16, torch.half, torch.bfloat16 | - |
| fit_mode | character | fit_preprocessors | low_memory, fit_preprocessors, fit_with_cache | - |
| memory_saving_mode | untyped | "auto" | - | |
| random_state | integer | 0 | |
|
| n_jobs | integer | - |
|
mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrTabPFN
marshaled(logical(1))
Whether the learner has been marshaled.
mlr3::Learner$base_learner()mlr3::Learner$configure()mlr3::Learner$encapsulate()mlr3::Learner$format()mlr3::Learner$help()mlr3::Learner$predict()mlr3::Learner$predict_newdata()mlr3::Learner$print()mlr3::Learner$reset()mlr3::Learner$selected_features()mlr3::Learner$train()mlr3::LearnerRegr$predict_newdata_fast()new()
Creates a new instance of this R6 class.
LearnerRegrTabPFN$new()
marshal()
Marshal the learner's model.
LearnerRegrTabPFN$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerRegrTabPFN$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerRegrTabPFN$clone(deep = FALSE)
deepWhether to make a deep clone.
b-zhou
Hollmann, Noah, Müller, Samuel, Purucker, Lennart, Krishnakumar, Arjun, Körfer, Max, Hoo, Bin S, Schirrmeister, Tibor R, Hutter, Frank (2025). “Accurate predictions on small data with a tabular foundation model.” Nature. doi:10.1038/s41586-024-08328-6, https://www.nature.com/articles/s41586-024-08328-6.
Hollmann, Noah, Müller, Samuel, Eggensperger, Katharina, Hutter, Frank (2023). “TabPFN: A transformer that solves small tabular classification problems in a second.” In International Conference on Learning Representations 2023.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Accelerated oblique random survival forest.
Calls aorsf::orsf() from aorsf.
Note that although the learner has the property "missing" and it can in
principle deal with missing values, the behaviour has to be configured using
the parameter na_action.
n_thread: This parameter is initialized to 1 (default is 0) to avoid conflicts with the mlr3 parallelization.
mtry:
This hyperparameter can alternatively be set via the added hyperparameter mtry_ratio
as mtry = max(ceiling(mtry_ratio * n_features), 1).
Note that mtry and mtry_ratio are mutually exclusive.
This learner returns three prediction types:
distr: a survival matrix in two dimensions, where observations are
represented in rows and (unique event) time points in columns.
Calculated using the internal predict.ObliqueForest() function.
response: the restricted mean survival time of each test observation,
derived from the survival matrix prediction (distr).
crank: the expected mortality using mlr3proba::surv_return().
This Learner can be instantiated via lrn():
lrn("surv.aorsf")
Task type: “surv”
Predict Types: “crank”, “distr”, “response”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3proba, mlr3extralearners, aorsf
| Id | Type | Default | Levels | Range |
| n_tree | integer | 500 | |
|
| n_split | integer | 5 | |
|
| n_retry | integer | 3 | |
|
| n_thread | integer | - | |
|
| pred_aggregate | logical | TRUE | TRUE, FALSE | - |
| pred_simplify | logical | FALSE | TRUE, FALSE | - |
| oobag | logical | FALSE | TRUE, FALSE | - |
| mtry | integer | NULL | |
|
| mtry_ratio | numeric | - | |
|
| sample_with_replacement | logical | TRUE | TRUE, FALSE | - |
| sample_fraction | numeric | 0.632 | |
|
| control_type | character | fast | fast, cph, net, custom | - |
| control_custom_fun | untyped | - | - | |
| split_rule | character | logrank | logrank, cstat | - |
| control_fast_do_scale | logical | FALSE | TRUE, FALSE | - |
| control_fast_ties | character | efron | efron, breslow | - |
| control_cph_ties | character | efron | efron, breslow | - |
| control_cph_eps | numeric | 1e-09 | |
|
| control_cph_iter_max | integer | 20 | |
|
| control_net_alpha | numeric | 0.5 | |
|
| control_net_df_target | integer | NULL | |
|
| leaf_min_events | integer | 1 | |
|
| leaf_min_obs | integer | 5 | |
|
| split_min_events | integer | 5 | |
|
| split_min_obs | integer | 10 | |
|
| split_min_stat | numeric | NULL | |
|
| oobag_pred_type | character | risk | none, surv, risk, chf, mort | - |
| importance | character | anova | none, anova, negate, permute | - |
| importance_max_pvalue | numeric | 0.01 | |
|
| tree_seeds | integer | NULL | |
|
| oobag_pred_horizon | numeric | NULL | |
|
| oobag_eval_every | integer | NULL | |
|
| oobag_fun | untyped | NULL | - | |
| attach_data | logical | TRUE | TRUE, FALSE | - |
| verbose_progress | logical | FALSE | TRUE, FALSE | - |
| na_action | character | fail | fail, impute_meanmode | - |
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvAorsf
new()
Creates a new instance of this R6 class.
LearnerSurvAorsf$new()
oob_error()
OOB concordance error extracted from the model slot
eval_oobag$stat_values
LearnerSurvAorsf$oob_error()
numeric().
importance()
The importance scores are extracted from the model.
LearnerSurvAorsf$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerSurvAorsf$clone(deep = FALSE)
deepWhether to make a deep clone.
bcjaeger
Jaeger BC, Long DL, Long DM, Sims M, Szychowski JM, Min Y, Mcclure LA, Howard G, Simon N (2019). “Oblique random survival forests.” The Annals of Applied Statistics, 13(3). doi:10.1214/19-aoas1261.
Jaeger BC, Welden S, Lenoir K, Speiser JL, Segar MW, Pandey A, Pajewski NM (2023). “Accelerated and interpretable oblique random survival forests.” Journal of Computational and Graphical Statistics, 1–16. doi:10.1080/10618600.2023.2231048.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.aorsf") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.aorsf") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Fits a Bayesian Additive Regression Trees (BART) learner to right-censored
survival data. Calls BART::mc.surv.bart() from BART.
This learner returns two prediction types:
distr: a 3d survival array with observations as 1st dimension, time
points as 2nd and the posterior draws as 3rd dimension.
Calculated using the internal predict.survbart() function.
crank: the expected mortality using mlr3proba::surv_return(). The parameter
which.curve decides which posterior draw (3rd dimension) will be used for the
calculation of the expected mortality. Note that the median posterior is
by default used for the calculation of survival measures that require a distr
prediction, see more info on PredictionSurv.
mc.cores is initialized to 1 to avoid threading conflicts with future.
quiet allows to suppress messages generated by the wrapped C++ code. Is
initialized to TRUE.
importance allows to choose the type of importance. Default is count,
see documentation of method $importance() for more details.
which.curve allows to choose which posterior draw will be used for the
calculation of the crank prediction. If between (0,1) it is taken as the
quantile of the curves otherwise if greater than 1 it is taken as the curve
index, can also be 'mean'. By default the median posterior is used,
i.e. which.curve is 0.5.
This Learner can be instantiated via lrn():
lrn("surv.bart")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “logical”, “integer”, “numeric”
| Id | Type | Default | Levels | Range |
| K | numeric | NULL | |
|
| events | untyped | NULL | - | |
| ztimes | untyped | NULL | - | |
| zdelta | untyped | NULL | - | |
| sparse | logical | FALSE | TRUE, FALSE | - |
| theta | numeric | 0 | |
|
| omega | numeric | 1 | |
|
| a | numeric | 0.5 | |
|
| b | numeric | 1 | |
|
| augment | logical | FALSE | TRUE, FALSE | - |
| rho | numeric | NULL | |
|
| usequants | logical | FALSE | TRUE, FALSE | - |
| rm.const | logical | TRUE | TRUE, FALSE | - |
| type | character | pbart | pbart, lbart | - |
| ntype | integer | - | |
|
| k | numeric | 2 | |
|
| power | numeric | 2 | |
|
| base | numeric | 0.95 | |
|
| offset | numeric | NULL | |
|
| ntree | integer | 50 | |
|
| numcut | integer | 100 | |
|
| ndpost | integer | 1000 | |
|
| nskip | integer | 250 | |
|
| keepevery | integer | 10 | |
|
| printevery | integer | 100 | |
|
| seed | integer | 99 | |
|
| mc.cores | integer | 2 | |
|
| nice | integer | 19 | |
|
| openmp | logical | TRUE | TRUE, FALSE | - |
| quiet | logical | TRUE | TRUE, FALSE | - |
| importance | character | count | count, prob | - |
| which.curve | numeric | - |
|
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvLearnerSurvBART
new()
Creates a new instance of this R6 class.
LearnerSurvLearnerSurvBART$new()
importance()
Two types of importance scores are supported based on the value
of the parameter importance:
prob: The mean selection probability of each feature in the trees,
extracted from the slot varprob.mean.
If sparse = FALSE (default), this is a fixed constant.
Recommended to use this option when sparse = TRUE.
count: The mean observed count of each feature in the trees (average
number of times the feature was used in a tree decision rule across all
posterior draws), extracted from the slot varcount.mean.
This is the default importance scores.
In both cases, higher values signify more important variables.
LearnerSurvLearnerSurvBART$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerSurvLearnerSurvBART$clone(deep = FALSE)
deepWhether to make a deep clone.
bblodfon
Sparapani, Rodney, Spanbauer, Charles, McCulloch, Robert (2021). “Nonparametric machine learning and efficient computation with bayesian additive regression trees: the BART R package.” Journal of Statistical Software, 97, 1–66.
Chipman, A H, George, I E, McCulloch, E R (2010). “BART: Bayesian additive regression trees.” The Annals of Applied Statistics, 4(1), 266–298.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
lrn("surv.bart")lrn("surv.bart")
Gradient boosting with regression trees for survival analysis.
Calls mboost::blackboost() from mboost.
distr prediction made by mboost::survFit().
This learner returns two to three prediction types:
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
Calculated using mboost::predict.blackboost().
If the family parameter is not "coxph", -lp is returned, since non-coxph
families represent AFT-style distributions where lower lp values indicate higher risk.
crank: same as lp.
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using mboost::survFit().
This prediction type is present only when the family distribution parameter
is equal to "coxph" (default).
By default the Breslow estimator is used for computing the baseline hazard.
This Learner can be instantiated via lrn():
lrn("surv.blackboost")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, mboost
| Id | Type | Default | Levels | Range |
| family | character | coxph | coxph, weibull, loglog, lognormal, gehan, cindex, custom | - |
| custom.family | untyped | - | - | |
| nuirange | untyped | c(0, 100) | - | |
| center | logical | TRUE | TRUE, FALSE | - |
| mstop | integer | 100 | |
|
| nu | numeric | 0.1 | |
|
| risk | character | - | inbag, oobag, none | - |
| stopintern | logical | FALSE | TRUE, FALSE | - |
| trace | logical | FALSE | TRUE, FALSE | - |
| oobweights | untyped | - | - | |
| teststat | character | quadratic | quadratic, maximum | - |
| splitstat | character | quadratic | quadratic, maximum | - |
| splittest | logical | FALSE | TRUE, FALSE | - |
| testtype | character | Bonferroni | Bonferroni, MonteCarlo, Univariate, Teststatistic | - |
| maxpts | integer | 25000 | |
|
| abseps | numeric | 0.001 | |
|
| releps | numeric | 0 | |
|
| nmax | untyped | - | - | |
| alpha | numeric | 0.05 | |
|
| mincriterion | numeric | 0.95 | |
|
| logmincriterion | numeric | -0.05129329 | |
|
| minsplit | integer | 20 | |
|
| minbucket | integer | 7 | |
|
| minprob | numeric | 0.01 | |
|
| stump | logical | FALSE | TRUE, FALSE | - |
| lookahead | logical | FALSE | TRUE, FALSE | - |
| MIA | logical | FALSE | TRUE, FALSE | - |
| nresample | integer | 9999 | |
|
| tol | numeric | 1.490116e-08 | |
|
| maxsurrogate | integer | 0 | |
|
| mtry | integer | - | |
|
| maxdepth | integer | - | |
|
| multiway | logical | FALSE | TRUE, FALSE | - |
| splittry | integer | 2 | |
|
| intersplit | logical | FALSE | TRUE, FALSE | - |
| majority | logical | FALSE | TRUE, FALSE | - |
| caseweights | logical | TRUE | TRUE, FALSE | - |
| sigma | numeric | 0.1 | |
|
| ipcw | untyped | 1 | - | |
| na.action | untyped | stats::na.omit | - |
If a Task contains a column with the offset role, it is automatically
incorporated via the offset argument in mboost's training function.
No offset is applied during prediction for this learner.
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvBlackBoost
new()
Creates a new instance of this R6 class.
LearnerSurvBlackBoost$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvBlackBoost$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Bühlmann, Peter, Yu, Bin (2003). “Boosting with the L 2 loss: regression and classification.” Journal of the American Statistical Association, 98(462), 324–339.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.blackboost") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.blackboost") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Random survival forests for blocks of clinical and omics covariate data.
Calls blockForest::blockfor() from package blockForest.
In this learner, only the trained forest object ($forest) is retained. The
optimized block-specific tuning parameters (paramvalues) and the biased OOB
error estimate (biased_oob_error_donotuse) are discarded, as they are either
not needed for downstream use or not reliable for performance estimation.
This learner returns two prediction types:
distr: a survival matrix in two dimensions, where observations are
represented in rows and (unique event) time points in columns.
Calculated using the internal blockForest:::predict.blockForest() function.
crank: the expected mortality using mlr3proba::surv_return().
num.threads is initialized to 1 to avoid conflicts with parallelization via future.
This Learner can be instantiated via lrn():
lrn("surv.blockforest")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3proba, mlr3extralearners, blockForest
| Id | Type | Default | Levels | Range |
| blocks | untyped | - | - | |
| block.method | character | BlockForest | BlockForest, RandomBlock, BlockVarSel, VarProb, SplitWeights | - |
| num.trees | integer | 2000 | |
|
| mtry | untyped | NULL | - | |
| nsets | integer | 300 | |
|
| num.trees.pre | integer | 1500 | |
|
| splitrule | character | extratrees | logrank, extratrees, C, maxstat | - |
| always.select.block | integer | 0 | |
|
| importance | character | - | none, impurity, impurity_corrected, permutation | - |
| num.threads | integer | - | |
|
| seed | integer | NULL | |
|
| verbose | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvBlockForest
new()
Creates a new instance of this R6 class.
LearnerSurvBlockForest$new()
importance()
The importance scores are extracted from the model slot variable.importance.
LearnerSurvBlockForest$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerSurvBlockForest$clone(deep = FALSE)
deepWhether to make a deep clone.
bblodfon
Hornung, R., Wright, N. M (2019). “Block Forests: Random forests for blocks of clinical and omics covariate data.” BMC Bioinformatics, 20(1), 1–17. doi:10.1186/s12859-019-2942-y, https://doi.org/10.1186/s12859-019-2942-y.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # check task's features task$feature_names # partition features to 2 blocks blocks = list(bl1 = 1:3, bl2 = 4:6) # define learner learner = lrn("surv.blockforest", blocks = blocks, importance = "permutation", nsets = 10, num.trees = 50, num.trees.pre = 10, splitrule = "logrank") # Train the learner on the training ids learner$train(task, row_ids = ids$train) # feature importance learner$importance() # Make predictions for the test observations pred = learner$predict(task, row_ids = ids$test) pred # Score the predictions pred$score()# Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # check task's features task$feature_names # partition features to 2 blocks blocks = list(bl1 = 1:3, bl2 = 4:6) # define learner learner = lrn("surv.blockforest", blocks = blocks, importance = "permutation", nsets = 10, num.trees = 50, num.trees.pre = 10, splitrule = "logrank") # Train the learner on the training ids learner$train(task, row_ids = ids$train) # feature importance learner$importance() # Make predictions for the test observations pred = learner$predict(task, row_ids = ids$test) pred # Score the predictions pred$score()
A random forest based on conditional inference trees (partykit::ctree()).
Calls partykit::cforest() from partykit.
This learner returns two prediction types:
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using the internal partykit::predict.cforest() function.
crank: the expected mortality using mlr3proba::surv_return().
This Learner can be instantiated via lrn():
lrn("surv.cforest")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3proba, mlr3extralearners, partykit, sandwich, coin, survdistr
| Id | Type | Default | Levels | Range |
| ntree | integer | 500 | |
|
| replace | logical | FALSE | TRUE, FALSE | - |
| fraction | numeric | 0.632 | |
|
| mtry | integer | - | |
|
| mtryratio | numeric | - | |
|
| applyfun | untyped | - | - | |
| cores | integer | NULL | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| cluster | untyped | - | - | |
| na.action | untyped | "stats::na.pass" | - | |
| scores | untyped | - | - | |
| teststat | character | quadratic | quadratic, maximum | - |
| splitstat | character | quadratic | quadratic, maximum | - |
| splittest | logical | FALSE | TRUE, FALSE | - |
| testtype | character | Univariate | Bonferroni, MonteCarlo, Univariate, Teststatistic | - |
| nmax | untyped | - | - | |
| alpha | numeric | 0.05 | |
|
| mincriterion | numeric | 0.95 | |
|
| logmincriterion | numeric | -0.05129329 | |
|
| minsplit | integer | 20 | |
|
| minbucket | integer | 7 | |
|
| minprob | numeric | 0.01 | |
|
| stump | logical | FALSE | TRUE, FALSE | - |
| lookahead | logical | FALSE | TRUE, FALSE | - |
| MIA | logical | FALSE | TRUE, FALSE | - |
| nresample | integer | 9999 | |
|
| tol | numeric | 1.490116e-08 | |
|
| maxsurrogate | integer | 0 | |
|
| numsurrogate | logical | FALSE | TRUE, FALSE | - |
| maxdepth | integer | Inf | |
|
| multiway | logical | FALSE | TRUE, FALSE | - |
| splittry | integer | 2 | |
|
| intersplit | logical | FALSE | TRUE, FALSE | - |
| majority | logical | FALSE | TRUE, FALSE | - |
| caseweights | logical | TRUE | TRUE, FALSE | - |
| saveinfo | logical | FALSE | TRUE, FALSE | - |
| update | logical | FALSE | TRUE, FALSE | - |
| splitflavour | character | ctree | ctree, exhaustive | - |
| maxvar | integer | - | |
|
| OOB | logical | FALSE | TRUE, FALSE | - |
| simplify | logical | TRUE | TRUE, FALSE | - |
| scale | logical | TRUE | TRUE, FALSE | - |
| maxpts | integer | 25000 | |
|
| abseps | numeric | 0.001 | |
|
| releps | numeric | 0 |
|
cores: This parameter is initialized to 1 (default is NULL) to avoid
threading conflicts with future.
mtry:
This hyperparameter can alternatively be set via the added hyperparameter mtryratio
as mtry = max(ceiling(mtryratio * n_features), 1).
Note that mtry and mtryratio are mutually exclusive.
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvCForest
new()
Creates a new instance of this R6 class.
LearnerSurvCForest$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvCForest$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Hothorn T, Zeileis A (2015). “partykit: A Modular Toolkit for Recursive Partytioning in R.” Journal of Machine Learning Research, 16(118), 3905-3909. http://jmlr.org/papers/v16/hothorn15a.html.
Hothorn T, Hornik K, Zeileis A (2006). “Unbiased Recursive Partitioning: A Conditional Inference Framework.” Journal of Computational and Graphical Statistics, 15(3), 651–674. doi:10.1198/106186006x133933, https://doi.org/10.1198/106186006x133933.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.cforest", ntree = 50L) print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.cforest", ntree = 50L) print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Fit a Survival Cox model with a likelihood based boosting algorithm.
Calls CoxBoost::CoxBoost() from package CoxBoost.
Use LearnerSurvCoxboost and LearnerSurvCVCoxboost for Cox boosting without and with internal
cross-validation of boosting step number, respectively. Tuning using the internal optimizer in
LearnerSurvCVCoxboost may be more efficient when tuning stepno only. However, for tuning
multiple hyperparameters, mlr3tuning and LearnerSurvCoxboost will likely give better
results.
This learner returns three prediction types, using the internal predict.CoxBoost() function:
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
crank: same as lp.
distr: a 2d survival matrix, with observations as rows and time points
as columns. The internal transformation uses the Breslow estimator to compute
the baseline hazard and compose the survival distributions from the lp predictions.
This Learner can be instantiated via lrn():
lrn("surv.coxboost")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, CoxBoost
| Id | Type | Default | Levels | Range |
| unpen.index | untyped | - | - | |
| standardize | logical | TRUE | TRUE, FALSE | - |
| stepno | integer | 100 | |
|
| penalty | numeric | - | |
|
| criterion | character | pscore | pscore, score, hpscore, hscore | - |
| stepsize.factor | numeric | 1 | |
|
| sf.scheme | character | sigmoid | sigmoid, linear | - |
| pendistmat | untyped | - | - | |
| connected.index | untyped | - | - | |
| x.is.01 | logical | FALSE | TRUE, FALSE | - |
| return.score | logical | TRUE | TRUE, FALSE | - |
| trace | logical | FALSE | TRUE, FALSE | - |
| at.step | untyped | - | - |
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvCoxboost
new()
Creates a new instance of this R6 class.
LearnerSurvCoxboost$new()
selected_features()
Returns the set of selected features which have non-zero coefficients.
Calls the internal coef.CoxBoost() function.
LearnerSurvCoxboost$selected_features(at_step = NULL)
at_step(integer(1))
Which boosting step to get the coefficients for. If no step is given
(default), the final boosting step is used.
(character()) vector of feature names.
clone()
The objects of this class are cloneable with this method.
LearnerSurvCoxboost$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Binder, Harald, Schumacher, Martin (2008). “Allowing for mandatory covariates in boosting estimation of sparse high-dimensional survival models.” BMC Bioinformatics, 9(1), 1-10. ISSN 14712105, doi:10.1186/1471-2105-9-14.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.coxboost") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.coxboost") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Survival Partition Tree where a significance test is used to determine the univariate splits.
Calls partykit::ctree() from partykit.
This learner returns two prediction types:
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using the internal partykit::predict.party() function.
crank: the expected mortality using mlr3proba::surv_return().
This Learner can be instantiated via lrn():
lrn("surv.ctree")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3proba, mlr3extralearners, partykit, coin, sandwich, survdistr
| Id | Type | Default | Levels | Range |
| teststat | character | quadratic | quadratic, maximum | - |
| splitstat | character | quadratic | quadratic, maximum | - |
| splittest | logical | FALSE | TRUE, FALSE | - |
| testtype | character | Bonferroni | Bonferroni, MonteCarlo, Univariate, Teststatistic | - |
| nmax | untyped | - | - | |
| alpha | numeric | 0.05 | |
|
| mincriterion | numeric | 0.95 | |
|
| logmincriterion | numeric | - | |
|
| minsplit | integer | 20 | |
|
| minbucket | integer | 7 | |
|
| minprob | numeric | 0.01 | |
|
| stump | logical | FALSE | TRUE, FALSE | - |
| lookahead | logical | FALSE | TRUE, FALSE | - |
| MIA | logical | FALSE | TRUE, FALSE | - |
| nresample | integer | 9999 | |
|
| tol | numeric | - | |
|
| maxsurrogate | integer | 0 | |
|
| numsurrogate | logical | FALSE | TRUE, FALSE | - |
| mtry | integer | Inf | |
|
| maxdepth | integer | Inf | |
|
| maxvar | integer | - | |
|
| multiway | logical | FALSE | TRUE, FALSE | - |
| splittry | integer | 2 | |
|
| intersplit | logical | FALSE | TRUE, FALSE | - |
| majority | logical | FALSE | TRUE, FALSE | - |
| caseweights | logical | FALSE | TRUE, FALSE | - |
| applyfun | untyped | - | - | |
| cores | integer | NULL | |
|
| saveinfo | logical | TRUE | TRUE, FALSE | - |
| update | logical | FALSE | TRUE, FALSE | - |
| splitflavour | character | ctree | ctree, exhaustive | - |
| cluster | untyped | - | - | |
| scores | untyped | - | - | |
| doFit | logical | TRUE | TRUE, FALSE | - |
| maxpts | integer | 25000 | |
|
| abseps | numeric | 0.001 | |
|
| releps | numeric | 0 |
|
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvCTree
new()
Creates a new instance of this R6 class.
LearnerSurvCTree$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvCTree$clone(deep = FALSE)
deepWhether to make a deep clone.
adibender
Hothorn T, Zeileis A (2015). “partykit: A Modular Toolkit for Recursive Partytioning in R.” Journal of Machine Learning Research, 16(118), 3905-3909. http://jmlr.org/papers/v16/hothorn15a.html.
Hothorn T, Hornik K, Zeileis A (2006). “Unbiased Recursive Partitioning: A Conditional Inference Framework.” Journal of Computational and Graphical Statistics, 15(3), 651–674. doi:10.1198/106186006x133933, https://doi.org/10.1198/106186006x133933.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.ctree") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.ctree") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Fits a survival Cox model using likelihood based boosting and internal cross-validation for the
number of steps.
Calls CoxBoost::CoxBoost() or CoxBoost::cv.CoxBoost() from package CoxBoost.
Use LearnerSurvCoxboost and LearnerSurvCVCoxboost for Cox boosting without and with internal
cross-validation of boosting step number, respectively. Tuning using the internal optimizer in
LearnerSurvCVCoxboost may be more efficient when tuning stepno only. However, for tuning
multiple hyperparameters, mlr3tuning and LearnerSurvCoxboost will likely give better
results.
If penalty == "optimCoxBoostPenalty" then CoxBoost::optimCoxBoostPenalty() is used to determine
the penalty value and optimal step to be used in CoxBoost::CoxBoost().
This Learner can be instantiated via lrn():
lrn("surv.cv_coxboost")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, CoxBoost
| Id | Type | Default | Levels | Range |
| maxstepno | integer | 100 | |
|
| K | integer | 10 | |
|
| type | character | verweij | verweij, naive | - |
| folds | untyped | NULL | - | |
| minstepno | integer | 50 | |
|
| start.penalty | numeric | - | |
|
| iter.max | integer | 10 | |
|
| upper.margin | numeric | 0.05 | |
|
| unpen.index | untyped | - | - | |
| standardize | logical | TRUE | TRUE, FALSE | - |
| penalty | numeric | - | |
|
| criterion | character | pscore | pscore, score, hpscore, hscore | - |
| stepsize.factor | numeric | 1 | |
|
| sf.scheme | character | sigmoid | sigmoid, linear | - |
| pendistmat | untyped | - | - | |
| connected.index | untyped | - | - | |
| x.is.01 | logical | FALSE | TRUE, FALSE | - |
| return.score | logical | TRUE | TRUE, FALSE | - |
| trace | logical | FALSE | TRUE, FALSE | - |
| at.step | untyped | - | - |
This learner returns three prediction types, using the internal predict.CoxBoost() function:
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
crank: same as lp.
distr: a 2d survival matrix, with observations as rows and time points
as columns. The internal transformation uses the Breslow estimator to compute
the baseline hazard and compose the survival distributions from the lp predictions.
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvCVCoxboost
new()
Creates a new instance of this R6 class.
LearnerSurvCVCoxboost$new()
selected_features()
Returns the set of selected features which have non-zero coefficients.
Calls the internal coef.CoxBoost() function.
LearnerSurvCVCoxboost$selected_features(at_step = NULL)
at_step(integer(1))
Which boosting step to get the coefficients for. If no step is given
(default), the final boosting step is used.
(character()) vector of feature names.
clone()
The objects of this class are cloneable with this method.
LearnerSurvCVCoxboost$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Binder, Harald, Schumacher, Martin (2008). “Allowing for mandatory covariates in boosting estimation of sparse high-dimensional survival models.” BMC Bioinformatics, 9(1), 1-10. ISSN 14712105, doi:10.1186/1471-2105-9-14.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
task = tsk("rats") task$col_roles$feature = c("litter", "rx") learner = lrn("surv.cv_coxboost", maxstepno = 20) splits = partition(task) learner$train(task, splits$train) pred = learner$predict(task, splits$test)task = tsk("rats") task$col_roles$feature = c("litter", "rx") learner = lrn("surv.cv_coxboost", maxstepno = 20) splits = partition(task) learner$train(task, splits$train) pred = learner$predict(task, splits$test)
Generalized linear models with elastic net regularization.
Calls glmnet::cv.glmnet() from package glmnet.
family is set to "cox" and cannot be changed.
This learner returns three prediction types:
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
Calculated using glmnet::predict.cv.glmnet().
crank: same as lp.
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using glmnet::survfit.cv.glmnet().
Parameters stype and ctype relate to how lp predictions are transformed
into survival predictions and are described in survival::survfit.coxph().
By default the Breslow estimator is used for computing the baseline hazard.
This Learner can be instantiated via lrn():
lrn("surv.cv_glmnet")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, glmnet
| Id | Type | Default | Levels | Range |
| alignment | character | lambda | lambda, fraction | - |
| alpha | numeric | 1 | |
|
| big | numeric | 9.9e+35 | |
|
| devmax | numeric | 0.999 | |
|
| dfmax | integer | - | |
|
| eps | numeric | 1e-06 | |
|
| epsnr | numeric | 1e-08 | |
|
| exclude | untyped | - | - | |
| exmx | numeric | 250 | |
|
| fdev | numeric | 1e-05 | |
|
| foldid | untyped | NULL | - | |
| gamma | untyped | - | - | |
| grouped | logical | TRUE | TRUE, FALSE | - |
| intercept | logical | TRUE | TRUE, FALSE | - |
| keep | logical | FALSE | TRUE, FALSE | - |
| lambda | untyped | - | - | |
| lambda.min.ratio | numeric | - | |
|
| lower.limits | untyped | -Inf | - | |
| maxit | integer | 100000 | |
|
| mnlam | integer | 5 | |
|
| mxit | integer | 100 | |
|
| mxitnr | integer | 25 | |
|
| nfolds | integer | 10 | |
|
| nlambda | integer | 100 | |
|
| use_pred_offset | logical | TRUE | TRUE, FALSE | - |
| parallel | logical | FALSE | TRUE, FALSE | - |
| penalty.factor | untyped | - | - | |
| pmax | integer | - | |
|
| pmin | numeric | 1e-09 | |
|
| prec | numeric | 1e-10 | |
|
| predict.gamma | numeric | gamma.1se | |
|
| relax | logical | FALSE | TRUE, FALSE | - |
| s | numeric | lambda.1se | |
|
| standardize | logical | TRUE | TRUE, FALSE | - |
| standardize.response | logical | FALSE | TRUE, FALSE | - |
| thresh | numeric | 1e-07 | |
|
| trace.it | integer | 0 | |
|
| type.gaussian | character | - | covariance, naive | - |
| type.logistic | character | Newton | Newton, modified.Newton | - |
| type.measure | character | deviance | deviance, C | - |
| type.multinomial | character | ungrouped | ungrouped, grouped | - |
| upper.limits | untyped | Inf | - | |
| stype | integer | 2 | |
|
| ctype | integer | - |
|
If a Task contains a column with the offset role, it is automatically
incorporated during training via the offset argument in glmnet::glmnet().
During prediction, the offset column from the test set is used only if
use_pred_offset = TRUE (default), passed via the newoffset argument in glmnet::predict.coxnet().
Otherwise, if the user sets use_pred_offset = FALSE, a zero offset is applied,
effectively disabling the offset adjustment during prediction.
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvCVGlmnet
new()
Creates a new instance of this R6 class.
LearnerSurvCVGlmnet$new()
selected_features()
Returns the set of selected features as reported by glmnet::predict.glmnet()
with type set to "nonzero".
LearnerSurvCVGlmnet$selected_features(lambda = NULL)
lambda(numeric(1))
Custom lambda, defaults to the active lambda depending on parameter set.
(character()) of feature names.
clone()
The objects of this class are cloneable with this method.
LearnerSurvCVGlmnet$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Friedman J, Hastie T, Tibshirani R (2010). “Regularization Paths for Generalized Linear Models via Coordinate Descent.” Journal of Statistical Software, 33(1), 1–22. doi:10.18637/jss.v033.i01.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.cv_glmnet") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.cv_glmnet") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
MCP- or SCAD-penalized regression survival model with k-fold cross validation
for choosing the regularization parameter lambda.
Calls ncvreg::cv.ncvsurv() from package ncvreg.
Covariates are internally standardized by ncvreg prior to model fitting.
This learner returns three prediction types (by default the lambda
corresponding to the minimum cross-validation error is used):
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
Calculated using ncvreg::predict.cv.ncvsurv() with type = "link".
crank: identical to lp.
distr: a survival probability matrix with dimensions
n_obs × n_times, where rows correspond to observations and
columns correspond to time points.
Calculated using ncvreg::predict.cv.ncvsurv() with type = "survival".
By default the Kalbfleisch-Prentice estimator is used for the survival function
and the time grid is defined by the unique time points in the training data.
This Learner can be instantiated via lrn():
lrn("surv.cv_ncvsurv")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, ncvreg
| Id | Type | Default | Levels | Range |
| penalty | character | MCP | MCP, SCAD, lasso | - |
| gamma | numeric | - | |
|
| alpha | numeric | 1 | |
|
| lambda.min | numeric | - | |
|
| nlambda | integer | 100 | |
|
| lambda | untyped | - | - | |
| eps | numeric | 1e-04 | |
|
| max.iter | integer | 10000 | |
|
| convex | logical | TRUE | TRUE, FALSE | - |
| dfmax | integer | - | |
|
| penalty.factor | untyped | - | - | |
| warn | logical | TRUE | TRUE, FALSE | - |
| returnX | logical | TRUE | TRUE, FALSE | - |
| cluster | untyped | - | - | |
| nfolds | integer | 10 | |
|
| fold | untyped | - | - | |
| se | character | quick | quick, bootstrap | - |
| returnY | logical | FALSE | TRUE, FALSE | - |
| trace | logical | FALSE | TRUE, FALSE | - |
| pred_lambda | numeric | - |
|
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvNCVsurv
new()
Creates a new instance of this R6 class.
LearnerSurvNCVsurv$new()
selected_features()
Returns the set of selected features which have non-zero coefficients.
Calls the internal coef.cv.ncvreg() function.
LearnerSurvNCVsurv$selected_features(lambda = NULL)
lambda(numeric(1))
Custom lambda, defaults to the lambda with the minimum CV error.
(character()) vector of feature names.
clone()
The objects of this class are cloneable with this method.
LearnerSurvNCVsurv$clone(deep = FALSE)
deepWhether to make a deep clone.
bblodfon
Breheny P, Huang J (2011). “Coordinate descent algorithms for nonconvex penalized regression, with applications to biological feature selection.” Annals of Applied Statistics, 5(1), 232–253. ISSN 1932-6157, doi:10.1214/10-AOAS388.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.cv_ncvsurv") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.cv_ncvsurv") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Flexible parametric learner.
Calls flexsurv::flexsurvreg() from flexsurv.
This Learner can be instantiated via lrn():
lrn("surv.flexreg")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”, “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, flexsurv, survival
| Id | Type | Default | Levels | Range |
| formula | untyped | - | - | |
| anc | untyped | - | - | |
| bhazard | untyped | - | - | |
| rtrunc | untyped | - | - | |
| dist | character | - | gengamma, gengamma.orig, genf, genf.orig, weibull, weibullph, gamma, exp, exponential, llogis, [...] | - |
| inits | untyped | - | - | |
| fixedpars | untyped | - | - | |
| cl | numeric | 0.95 | |
|
| hessian | logical | TRUE | TRUE, FALSE | - |
| hess.control | untyped | - | - | |
| maxiter | integer | 30 | |
|
| rel.tolerance | numeric | 1e-09 | |
|
| toler.chol | numeric | 1e-10 | |
|
| debug | integer | 0 | |
|
| outer.max | integer | 10 | |
|
| times | untyped | - | - |
This learner returns three prediction types:
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
Calculated using predict.flexsurvreg(type = "lp", ...).
The interpretation whether higher lp corresponds to higher risk or higher
survival, depends on the distribution choice (see dist parameter documentation).
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using predict.flexsurvreg(type = "survival", ...).
crank: same as lp.
response: mean survival time calculated using predict.flexsurvreg(type = "response", ...).
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvFlexReg
new()
Creates a new instance of this R6 class.
LearnerSurvFlexReg$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvFlexReg$clone(deep = FALSE)
deepWhether to make a deep clone.
bblodfon
Jackson, H. C (2016). “flexsurv: A Platform for Parametric Survival Modeling in R.” Journal of Statistical Software, 70(8), 1–33. doi:10.18637/JSS.V070.I08, https://www.jstatsoft.org/index.php/jss/article/view/v070i08.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
library(survival) # Define the task, split to train/test set task = tsk("lung") set.seed(42) part = partition(task) # Define the learner learner = lrn("surv.flexreg", formula = survival::Surv(time, status) ~ age + ph.karno + sex, anc = list(shape = ~ sex), dist = "weibull") # Train the learner on the training ids learner$train(task, part$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, part$test) print(predictions) # Score the predictions predictions$score()library(survival) # Define the task, split to train/test set task = tsk("lung") set.seed(42) part = partition(task) # Define the learner learner = lrn("surv.flexreg", formula = survival::Surv(time, status) ~ age + ph.karno + sex, anc = list(shape = ~ sex), dist = "weibull") # Train the learner on the training ids learner$train(task, part$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, part$test) print(predictions) # Score the predictions predictions$score()
Flexible survival regression using the Royston/Parmar spline model.
Calls flexsurv::flexsurvspline() from flexsurv.
This Learner can be instantiated via lrn():
lrn("surv.flexspline")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”, “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, flexsurv, survival
| Id | Type | Default | Levels | Range |
| formula | untyped | - | - | |
| bhazard | untyped | - | - | |
| rtrunc | untyped | - | - | |
| k | integer | 0 | |
|
| knots | untyped | - | - | |
| bknots | untyped | - | - | |
| scale | character | hazard | hazard, odds, normal | - |
| timescale | character | log | log, identity | - |
| spline | character | rp | rp, splines2ns | - |
| inits | untyped | - | - | |
| fixedpars | untyped | - | - | |
| cl | numeric | 0.95 | |
|
| anc | untyped | - | - | |
| maxiter | integer | 30 | |
|
| rel.tolerance | numeric | 1e-09 | |
|
| toler.chol | numeric | 1e-10 | |
|
| debug | integer | 0 | |
|
| outer.max | integer | 10 | |
|
| times | untyped | - | - |
This learner returns three prediction types:
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
Calculated using predict.flexsurvreg(type = "lp", ...).
Higher linear predictor gives higher hazard (equivalently, lower survival)
for the spline models.
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using predict.flexsurvreg(type = "survival", ...).
crank: same as lp.
response: mean survival time calculated using predict.flexsurvreg(type = "response", ...)
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvFlexSpline
new()
Creates a new instance of this R6 class.
LearnerSurvFlexSpline$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvFlexSpline$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Royston, Patrick, Parmar, KB M (2002). “Flexible parametric proportional-hazards and proportional-odds models for censored survival data, with application to prognostic modelling and estimation of treatment effects.” Statistics in medicine, 21(15), 2175–2197.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
library(survival) # Define the task, split to train/test set task = tsk("lung") set.seed(42) part = partition(task) # Define the learner learner = lrn("surv.flexspline", k = 1, formula = survival::Surv(time, status) ~ age + ph.karno + sex, anc = list(gamma1 = ~ sex)) # Train the learner on the training ids learner$train(task, part$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, part$test) print(predictions) # Score the predictions predictions$score()library(survival) # Define the task, split to train/test set task = tsk("lung") set.seed(42) part = partition(task) # Define the learner learner = lrn("surv.flexspline", k = 1, formula = survival::Surv(time, status) ~ age + ph.karno + sex, anc = list(gamma1 = ~ sex)) # Train the learner on the training ids learner$train(task, part$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, part$test) print(predictions) # Score the predictions predictions$score()
Cox proportional hazards model fitted via generalized additive modeling.
Internally calls mgcv::gam() from the mgcv package with
family = mgcv::cox.ph(). The censoring indicator is passed via the
weights argument.
Three types of prediction are returned for this learner:
lp: a vector of linear predictors (relative risk scores), one per
observation. Calls mgcv::predict.gam() with type = "link".
crank: same as lp.
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
By default, the Breslow estimator is used via mlr3proba::breslow().
This Learner can be instantiated via lrn():
lrn("surv.gam.cox")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, mgcv
| Id | Type | Default | Levels | Range |
| formula | untyped | - | - | |
| method | character | GCV.Cp | GCV.Cp, GACV.Cp, REML, P-REML, ML, P-ML | - |
| optimizer | untyped | c("outer", "newton") | - | |
| scale | numeric | 0 | |
|
| select | logical | FALSE | TRUE, FALSE | - |
| knots | untyped | NULL | - | |
| sp | untyped | NULL | - | |
| min.sp | untyped | NULL | - | |
| H | untyped | NULL | - | |
| gamma | numeric | 1 | |
|
| paraPen | untyped | NULL | - | |
| G | untyped | NULL | - | |
| in.out | untyped | NULL | - | |
| drop.unused.levels | logical | TRUE | TRUE, FALSE | - |
| drop.intercept | logical | FALSE | TRUE, FALSE | - |
| nei | untyped | - | - | |
| nthreads | integer | 1 | |
|
| ncv.threads | integer | 1 | |
|
| irls.reg | numeric | 0 | |
|
| epsilon | numeric | 1e-07 | |
|
| maxit | integer | 200 | |
|
| mgcv.tol | numeric | 1e-07 | |
|
| mgcv.half | integer | 15 | |
|
| trace | logical | FALSE | TRUE, FALSE | - |
| rank.tol | numeric | 1.490116e-08 | |
|
| nlm | untyped | list() | - | |
| optim | untyped | list() | - | |
| newton | untyped | list() | - | |
| idLinksBases | logical | TRUE | TRUE, FALSE | - |
| scalePenalty | logical | TRUE | TRUE, FALSE | - |
| efs.lspmax | integer | 15 | |
|
| efs.tol | numeric | 0.1 | |
|
| scale.est | character | fletcher | fletcher, pearson, deviance | - |
| edge.correct | logical | FALSE | TRUE, FALSE | - |
| block.size | integer | 1000 | |
|
| unconditional | logical | FALSE | TRUE, FALSE | - |
A gam formula specific to the task at hand is required for the formula
parameter (see example and ?mgcv::formula.gam). Beware, if no formula is provided, a fallback formula is
used that will make the gam behave like a glm (this behavior is required
for the unit tests). Only features specified in the formula will be used,
superseding columns with col_roles "feature" in the task.
If a Task contains a column with the offset role, it is automatically
incorporated during training via the offset argument in mgcv::gam().
No offset is applied during prediction for this learner.
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvGamCox
new()
Creates a new instance of this R6 class.
LearnerSurvGamCox$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvGamCox$clone(deep = FALSE)
deepWhether to make a deep clone.
bblodfon
Wood, Simon (2012). “mgcv: Mixed GAM Computation Vehicle with GCV/AIC/REML smoothness estimation.”
Wood, N. S, Pya, Natalya, Safken, Benjamin (2016). “Smoothing Parameter and Model Selection for General Smooth Models.” Journal of the American Statistical Association, 111(516), 1548–1563. doi:10.1080/01621459.2016.1180986.
# simple example t = tsk("lung") l = lrn("surv.gam.cox") l$param_set$set_values(formula = time ~ s(age, k = 5) + ph.karno + sex) l$train(t) l$model# simple example t = tsk("lung") l = lrn("surv.gam.cox") l$param_set$set_values(formula = time ~ s(age, k = 5) + ph.karno + sex) l$train(t) l$model
Fits a generalized additive survival model using a boosting algorithm.
Calls mboost::gamboost() from mboost.
This Learner can be instantiated via lrn():
lrn("surv.gamboost")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, mboost
| Id | Type | Default | Levels | Range |
| family | character | coxph | coxph, weibull, loglog, lognormal, gehan, cindex, custom | - |
| custom.family | untyped | - | - | |
| nuirange | untyped | c(0, 100) | - | |
| center | logical | TRUE | TRUE, FALSE | - |
| mstop | integer | 100 | |
|
| nu | numeric | 0.1 | |
|
| risk | character | inbag | inbag, oobag, none | - |
| stopintern | untyped | FALSE | - | |
| trace | logical | FALSE | TRUE, FALSE | - |
| oobweights | untyped | NULL | - | |
| baselearner | character | bbs | bbs, bols, btree | - |
| dfbase | integer | 4 | |
|
| sigma | numeric | 0.1 | |
|
| ipcw | untyped | 1 | - | |
| na.action | untyped | stats::na.omit | - |
This learner returns two to three prediction types:
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
Calculated using mboost::predict.gamboost().
If the family parameter is not "coxph", -lp is returned, since non-coxph
families represent AFT-style distributions where lower lp values indicate higher risk.
crank: same as lp.
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using mboost::survFit().
This prediction type is present only when the family distribution parameter
is equal to "coxph" (default).
By default the Breslow estimator is used for computing the baseline hazard.
If a Task contains a column with the offset role, it is automatically
incorporated via the offset argument in mboost's training function.
No offset is applied during prediction for this learner.
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvGAMBoost
new()
Creates a new instance of this R6 class.
LearnerSurvGAMBoost$new()
importance()
The importance scores are extracted with the function mboost::varimp()
with the default arguments.
LearnerSurvGAMBoost$importance()
Named numeric().
selected_features()
Selected features are extracted with the function
mboost::variable.names.mboost(), with
used.only = TRUE.
LearnerSurvGAMBoost$selected_features()
character().
clone()
The objects of this class are cloneable with this method.
LearnerSurvGAMBoost$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Bühlmann, Peter, Yu, Bin (2003). “Boosting with the L 2 loss: regression and classification.” Journal of the American Statistical Association, 98(462), 324–339.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
lrn("surv.gamboost")lrn("surv.gamboost")
Gradient Boosting for Survival Analysis.
Calls gbm::gbm() from gbm.
This learner returns two prediction types, using the internal predict.gbm() function:
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
crank: same as lp.
This Learner can be instantiated via lrn():
lrn("surv.gbm")
Task type: “surv”
Predict Types: “crank”, “lp”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3proba, mlr3extralearners, gbm
| Id | Type | Default | Levels | Range |
| distribution | character | coxph | coxph | - |
| n.trees | integer | 100 | |
|
| cv.folds | integer | 0 | |
|
| interaction.depth | integer | 1 | |
|
| n.minobsinnode | integer | 10 | |
|
| shrinkage | numeric | 0.001 | |
|
| bag.fraction | numeric | 0.5 | |
|
| train.fraction | numeric | 1 | |
|
| keep.data | logical | FALSE | TRUE, FALSE | - |
| verbose | logical | FALSE | TRUE, FALSE | - |
| var.monotone | untyped | - | - | |
| n.cores | integer | 1 | |
|
| single.tree | logical | FALSE | TRUE, FALSE | - |
distribution:
Actual default: "bernoulli"
Adjusted default: "coxph"
Reason for change: This is the only distribution available for survival.
keep.data:
Actual default: TRUE
Adjusted default: FALSE
Reason for change: keep.data = FALSE saves memory during model fitting.
n.cores:
Actual default: NULL
Adjusted default: 1
Reason for change: Suppressing the automatic internal parallelization if
cv.folds > 0 and avoid threading conflicts with future.
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvGBM
new()
Creates a new instance of this R6 class.
LearnerSurvGBM$new()
importance()
The importance scores are extracted from the model slot variable.importance.
LearnerSurvGBM$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerSurvGBM$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Friedman, H J (2002). “Stochastic gradient boosting.” Computational statistics & data analysis, 38(4), 367–378.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.gbm") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.gbm") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Fits a generalized linear survival model using a boosting algorithm.
Calls mboost::glmboost() from mboost.
This Learner can be instantiated via lrn():
lrn("surv.glmboost")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, mboost
| Id | Type | Default | Levels | Range |
| family | character | coxph | coxph, weibull, loglog, lognormal, gehan, cindex, custom | - |
| custom.family | untyped | - | - | |
| nuirange | untyped | c(0, 100) | - | |
| center | logical | TRUE | TRUE, FALSE | - |
| mstop | integer | 100 | |
|
| nu | numeric | 0.1 | |
|
| risk | character | inbag | inbag, oobag, none | - |
| oobweights | untyped | NULL | - | |
| stopintern | logical | FALSE | TRUE, FALSE | - |
| trace | logical | FALSE | TRUE, FALSE | - |
| sigma | numeric | 0.1 | |
|
| ipcw | untyped | 1 | - | |
| na.action | untyped | stats::na.omit | - | |
| contrasts.arg | untyped | - | - |
This learner returns two to three prediction types:
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
Calculated using mboost::predict.glmboost().
If the family parameter is not "coxph", -lp is returned, since non-coxph
families represent AFT-style distributions where lower lp values indicate higher risk.
crank: same as lp.
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using mboost::survFit().
This prediction type is present only when the family distribution parameter
is equal to "coxph" (default).
By default the Breslow estimator is used for computing the baseline hazard.
If a Task contains a column with the offset role, it is automatically
incorporated via the offset argument in mboost's training function.
No offset is applied during prediction for this learner.
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvGLMBoost
new()
Creates a new instance of this R6 class.
LearnerSurvGLMBoost$new()
importance()
Importance scores are extracted with the function mboost::varimp() and
represent a feature's individual contribution to the risk reduction per
boosting step of the fitted model.
The higher the risk reduction, the larger the feature importance.
Note: Importance is supported only for datasets with numeric
features, as the presence of factors with multiple levels makes it
difficult to get the original feature names.
LearnerSurvGLMBoost$importance()
Named numeric().
selected_features()
Selected features are extracted with the function mboost::coef.glmboost()
which by default returns features with non-zero coefficients and for the
final number of boosting iterations.
Note: Selected features can be retrieved only for datasets with
numeric features, as the presence of factors with multiple levels makes
it difficult to get the original feature names.
LearnerSurvGLMBoost$selected_features()
character().
clone()
The objects of this class are cloneable with this method.
LearnerSurvGLMBoost$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Bühlmann, Peter, Yu, Bin (2003). “Boosting with the L 2 loss: regression and classification.” Journal of the American Statistical Association, 98(462), 324–339.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.glmboost") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.glmboost") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Generalized linear models with elastic net regularization.
Calls glmnet::glmnet() from package glmnet.
family is set to "cox" and cannot be changed.
This learner returns three prediction types:
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
Calculated using glmnet::predict.coxnet().
crank: same as lp.
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using glmnet::survfit.coxnet().
Parameters stype and ctype relate to how lp predictions are transformed
into survival predictions and are described in survival::survfit.coxph().
By default the Breslow estimator is used for computing the baseline hazard.
Caution: This learner is different to learners calling glmnet::cv.glmnet()
in that it does not use the internal optimization of parameter lambda.
Instead, lambda needs to be tuned by the user (e.g., via mlr3tuning).
When lambda is tuned, the glmnet will be trained for each tuning iteration.
While fitting the whole path of lambdas would be more efficient, as is done
by default in glmnet::glmnet(), tuning/selecting the parameter at prediction time
(using parameter s) is currently not supported in mlr3
(at least not in efficient manner).
Tuning the s parameter is, therefore, currently discouraged.
When the data are i.i.d. and efficiency is key, we recommend using the respective
auto-tuning counterpart in mlr_learners_surv.cv_glmnet().
However, in some situations this is not applicable, usually when data are
imbalanced or not i.i.d. (longitudinal, time-series) and tuning requires
custom resampling strategies (blocked design, stratification).
If a Task contains a column with the offset role, it is automatically
incorporated during training via the offset argument in glmnet::glmnet().
During prediction, the offset column from the test set is used only if
use_pred_offset = TRUE (default), passed via the newoffset argument in glmnet::predict.coxnet().
Otherwise, if the user sets use_pred_offset = FALSE, a zero offset is applied,
effectively disabling the offset adjustment during prediction.
This Learner can be instantiated via lrn():
lrn("surv.glmnet")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, glmnet
| Id | Type | Default | Levels | Range |
| alignment | character | lambda | lambda, fraction | - |
| alpha | numeric | 1 | |
|
| big | numeric | 9.9e+35 | |
|
| devmax | numeric | 0.999 | |
|
| dfmax | integer | - | |
|
| eps | numeric | 1e-06 | |
|
| epsnr | numeric | 1e-08 | |
|
| exact | logical | FALSE | TRUE, FALSE | - |
| exclude | untyped | - | - | |
| exmx | numeric | 250 | |
|
| fdev | numeric | 1e-05 | |
|
| gamma | untyped | - | - | |
| grouped | logical | TRUE | TRUE, FALSE | - |
| intercept | logical | TRUE | TRUE, FALSE | - |
| keep | logical | FALSE | TRUE, FALSE | - |
| lambda | untyped | - | - | |
| lambda.min.ratio | numeric | - | |
|
| lower.limits | untyped | -Inf | - | |
| maxit | integer | 100000 | |
|
| mnlam | integer | 5 | |
|
| mxit | integer | 100 | |
|
| mxitnr | integer | 25 | |
|
| nlambda | integer | 100 | |
|
| use_pred_offset | logical | TRUE | TRUE, FALSE | - |
| parallel | logical | FALSE | TRUE, FALSE | - |
| penalty.factor | untyped | - | - | |
| pmax | integer | - | |
|
| pmin | numeric | 1e-09 | |
|
| prec | numeric | 1e-10 | |
|
| predict.gamma | numeric | gamma.1se | |
|
| relax | logical | FALSE | TRUE, FALSE | - |
| s | numeric | 0.01 | |
|
| standardize | logical | TRUE | TRUE, FALSE | - |
| thresh | numeric | 1e-07 | |
|
| trace.it | integer | 0 | |
|
| type.logistic | character | Newton | Newton, modified.Newton | - |
| type.multinomial | character | ungrouped | ungrouped, grouped | - |
| upper.limits | untyped | Inf | - | |
| stype | integer | 2 | |
|
| ctype | integer | - |
|
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvGlmnet
new()
Creates a new instance of this R6 class.
LearnerSurvGlmnet$new()
selected_features()
Returns the set of selected features as reported by glmnet::predict.glmnet()
with type set to "nonzero".
LearnerSurvGlmnet$selected_features(lambda = NULL)
lambda(numeric(1))
Custom lambda, defaults to the active lambda depending on parameter set.
(character()) of feature names.
clone()
The objects of this class are cloneable with this method.
LearnerSurvGlmnet$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Friedman J, Hastie T, Tibshirani R (2010). “Regularization Paths for Generalized Linear Models via Coordinate Descent.” Journal of Statistical Software, 33(1), 1–22. doi:10.18637/jss.v033.i01.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.glmnet") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.glmnet") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Model-based boosting for survival analysis.
Calls mboost::mboost() from mboost.
distr prediction made by mboost::survFit().
This learner returns two to three prediction types:
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
Calculated using mboost::predict.mboost().
If the family parameter is not "coxph", -lp is returned, since non-coxph
families represent AFT-style distributions where lower lp values indicate higher risk.
crank: same as lp.
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using mboost::survFit().
This prediction type is present only when the family distribution parameter
is equal to "coxph" (default).
By default the Breslow estimator is used for computing the baseline hazard.
This Learner can be instantiated via lrn():
lrn("surv.mboost")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, mboost
| Id | Type | Default | Levels | Range |
| family | character | coxph | coxph, weibull, loglog, lognormal, gehan, cindex, custom | - |
| custom.family | untyped | - | - | |
| nuirange | untyped | c(0, 100) | - | |
| center | logical | TRUE | TRUE, FALSE | - |
| mstop | integer | 100 | |
|
| nu | numeric | 0.1 | |
|
| risk | character | inbag | inbag, oobag, none | - |
| stopintern | logical | FALSE | TRUE, FALSE | - |
| trace | logical | FALSE | TRUE, FALSE | - |
| oobweights | untyped | NULL | - | |
| baselearner | character | bbs | bbs, bols, btree | - |
| sigma | numeric | 0.1 | |
|
| ipcw | untyped | 1 | - | |
| na.action | untyped | stats::na.omit | - |
If a Task contains a column with the offset role, it is automatically
incorporated via the offset argument in mboost's training function.
No offset is applied during prediction for this learner.
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvMBoost
new()
Creates a new instance of this R6 class.
LearnerSurvMBoost$new()
importance()
The importance scores are extracted with the function mboost::varimp() with the
default arguments.
LearnerSurvMBoost$importance()
Named numeric().
selected_features()
Selected features are extracted with the function mboost::variable.names.mboost(), with
used.only = TRUE.
LearnerSurvMBoost$selected_features()
character().
clone()
The objects of this class are cloneable with this method.
LearnerSurvMBoost$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Bühlmann, Peter, Yu, Bin (2003). “Boosting with the L 2 loss: regression and classification.” Journal of the American Statistical Association, 98(462), 324–339.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
lrn("surv.mboost")lrn("surv.mboost")
Non-parametric estimator of the cumulative hazard rate function.
Calls survival::survfit() from survival.
This learner returns two prediction types:
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
The cumulative hazard is calculated using the train data and the
default parameters of the survival::survfit() function, i.e. ctype = 1,
which uses the Nelson-Aalen formula.
Then for each test observation the survival curve is .
crank: the expected mortality using mlr3proba::surv_return().
This Learner can be instantiated via lrn():
lrn("surv.nelson")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, mlr3proba, mlr3extralearners, survival
Empty ParamSet
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvNelson
new()
Creates a new instance of this R6 class.
LearnerSurvNelson$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvNelson$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Nelson, Wayne (1969). “Hazard plotting for incomplete failure data.” Journal of Quality Technology, 1(1), 27–52.
Nelson, Wayne (1972). “Theory and applications of hazard plotting for censored failure data.” Technometrics, 14(4), 945–966.
Aalen, Odd (1978). “Nonparametric inference for a family of counting processes.” The Annals of Statistics, 701–726.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.nelson") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.nelson") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Penalized (L1 and L2) Cox Proportional Hazards model.
Calls penalized::penalized() from penalized.
The penalized and unpenalized arguments in the learner are implemented slightly
differently than in penalized::penalized(). Here, there is no parameter for penalized but
instead it is assumed that every variable is penalized unless stated in the unpenalized
parameter.
This learner returns two prediction types:
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using the internal penalized::predict() function.
By default the Breslow estimator penalized::breslow() is used for computing
the baseline hazard.
crank: the expected mortality using mlr3proba::surv_return().
trace is set to "FALSE" to disable printing output during model training.
This Learner can be instantiated via lrn():
lrn("surv.penalized")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, penalized
| Id | Type | Default | Levels | Range |
| unpenalized | untyped | - | - | |
| lambda1 | untyped | 0 | - | |
| lambda2 | untyped | 0 | - | |
| positive | logical | FALSE | TRUE, FALSE | - |
| fusedl | logical | FALSE | TRUE, FALSE | - |
| startbeta | numeric | - | |
|
| startgamma | numeric | - | |
|
| steps | integer | 1 | |
|
| epsilon | numeric | 1e-10 | |
|
| maxiter | integer | - | |
|
| standardize | logical | FALSE | TRUE, FALSE | - |
| trace | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvPenalized
new()
Creates a new instance of this R6 class.
LearnerSurvPenalized$new()
selected_features()
Selected features are extracted with the method coef() of the S4 model
object, see penalized::penfit().
By default it returns features with non-zero coefficients.
Note: Selected features can be retrieved only for datasets with
numeric features, as the presence of factors with multiple levels makes
it difficult to get the original feature names.
LearnerSurvPenalized$selected_features()
character().
clone()
The objects of this class are cloneable with this method.
LearnerSurvPenalized$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Goeman, J J (2010). “L1 penalized estimation in the Cox proportional hazards model.” Biometrical journal, 52(1), 70–84.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.penalized") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.penalized") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Patient outcome prediction based on multi-omics data taking practitioners’ preferences into account.
Calls prioritylasso::prioritylasso() from prioritylasso.
Many parameters for this survival learner are the same as mlr_learners_surv.cv_glmnet
as prioritylasso() calls glmnet::cv.glmnet() during training phase.
Note that prioritylasso() has ways to deal with block-wise missing data,
but this feature is not supported currently.
This learner returns three prediction types:
lp: a vector containing the linear predictors (relative risk scores),
where each score corresponds to a specific test observation.
Calculated using prioritylasso::predict.prioritylasso().
crank: same as lp.
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using mlr3proba::breslow() where the Breslow estimator is used
for computing the baseline hazard.
family is set to "cox" for the Cox survival objective and cannot be changed
type.measure set to "deviance" (cross-validation measure)
This Learner can be instantiated via lrn():
lrn("surv.priority_lasso")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “logical”, “integer”, “numeric”
Required Packages: mlr3, mlr3proba, prioritylasso
| Id | Type | Default | Levels | Range |
| blocks | untyped | - | - | |
| max.coef | untyped | NULL | - | |
| block1.penalization | logical | TRUE | TRUE, FALSE | - |
| lambda.type | character | lambda.min | lambda.min, lambda.1se | - |
| standardize | logical | TRUE | TRUE, FALSE | - |
| nfolds | integer | 5 | |
|
| foldid | untyped | NULL | - | |
| cvoffset | logical | FALSE | TRUE, FALSE | - |
| cvoffsetnfolds | integer | 10 | |
|
| return.x | logical | TRUE | TRUE, FALSE | - |
| include.allintercepts | logical | FALSE | TRUE, FALSE | - |
| use.blocks | untyped | "all" | - | |
| alignment | character | lambda | lambda, fraction | - |
| alpha | numeric | 1 | |
|
| big | numeric | 9.9e+35 | |
|
| devmax | numeric | 0.999 | |
|
| dfmax | integer | - | |
|
| eps | numeric | 1e-06 | |
|
| epsnr | numeric | 1e-08 | |
|
| exclude | untyped | - | - | |
| exmx | numeric | 250 | |
|
| fdev | numeric | 1e-05 | |
|
| gamma | untyped | - | - | |
| grouped | logical | TRUE | TRUE, FALSE | - |
| intercept | logical | TRUE | TRUE, FALSE | - |
| keep | logical | FALSE | TRUE, FALSE | - |
| lambda | untyped | - | - | |
| lambda.min.ratio | numeric | - | |
|
| lower.limits | untyped | -Inf | - | |
| maxit | integer | 100000 | |
|
| mnlam | integer | 5 | |
|
| mxit | integer | 100 | |
|
| mxitnr | integer | 25 | |
|
| nlambda | integer | 100 | |
|
| offset | untyped | NULL | - | |
| parallel | logical | FALSE | TRUE, FALSE | - |
| penalty.factor | untyped | - | - | |
| pmax | integer | - | |
|
| pmin | numeric | 1e-09 | |
|
| prec | numeric | 1e-10 | |
|
| standardize.response | logical | FALSE | TRUE, FALSE | - |
| thresh | numeric | 1e-07 | |
|
| trace.it | integer | 0 | |
|
| type.gaussian | character | - | covariance, naive | - |
| type.logistic | character | Newton | Newton, modified.Newton | - |
| type.multinomial | character | ungrouped | ungrouped, grouped | - |
| upper.limits | untyped | Inf | - | |
| relax | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvPriorityLasso
new()
Creates a new instance of this R6 class.
LearnerSurvPriorityLasso$new()
selected_features()
Selected features, i.e. those where the coefficient is non-zero.
LearnerSurvPriorityLasso$selected_features()
character().
clone()
The objects of this class are cloneable with this method.
LearnerSurvPriorityLasso$clone(deep = FALSE)
deepWhether to make a deep clone.
HarutyunyanLiana
Simon K, Vindi J, Roman H, Tobias H, Anne-Laure B (2018). “Priority-Lasso: a simple hierarchical approach to the prediction of clinical outcome using multi-omics data.” BMC Bioinformatics, 19. doi:10.1186/s12859-018-2344-6.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # check task's features task$feature_names # partition features to 2 blocks blocks = list(bl1 = 1:3, bl2 = 4:6) # define learner learner = lrn("surv.priority_lasso", blocks = blocks, block1.penalization = FALSE, lambda.type = "lambda.1se", standardize = TRUE, nfolds = 5) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # selected features learner$selected_features() # Make predictions for the test observations pred = learner$predict(task, row_ids = ids$test) pred # Score the predictions pred$score()# Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # check task's features task$feature_names # partition features to 2 blocks blocks = list(bl1 = 1:3, bl2 = 4:6) # define learner learner = lrn("surv.priority_lasso", blocks = blocks, block1.penalization = FALSE, lambda.type = "lambda.1se", standardize = TRUE, nfolds = 5) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # selected features learner$selected_features() # Make predictions for the test observations pred = learner$predict(task, row_ids = ids$test) pred # Score the predictions pred$score()
Random survival forest.
Calls ranger::ranger() from package ranger.
This learner returns two prediction types:
distr: a survival matrix in two dimensions, where observations are
represented in rows and (unique event) time points in columns.
Calculated using the internal ranger::predict.ranger() function.
crank: the expected mortality using mlr3proba::surv_return().
mtry: This hyperparameter can alternatively be set via our hyperparameter
mtry.ratio as mtry = max(ceiling(mtry.ratio * n_features), 1).
Note that mtry and mtry.ratio are mutually exclusive.
num.threads is initialized to 1 to avoid conflicts with parallelization via future.
This Learner can be instantiated via lrn():
lrn("surv.ranger")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, mlr3proba, mlr3extralearners, ranger
| Id | Type | Default | Levels | Range |
| alpha | numeric | 0.5 | |
|
| always.split.variables | untyped | - | - | |
| holdout | logical | FALSE | TRUE, FALSE | - |
| importance | character | - | none, impurity, impurity_corrected, permutation | - |
| keep.inbag | logical | FALSE | TRUE, FALSE | - |
| max.depth | integer | NULL | |
|
| min.node.size | integer | 5 | |
|
| minprop | numeric | 0.1 | |
|
| mtry | integer | - | |
|
| mtry.ratio | numeric | - | |
|
| num.random.splits | integer | 1 | |
|
| num.threads | integer | 1 | |
|
| num.trees | integer | 500 | |
|
| oob.error | logical | TRUE | TRUE, FALSE | - |
| regularization.factor | untyped | 1 | - | |
| regularization.usedepth | logical | FALSE | TRUE, FALSE | - |
| replace | logical | TRUE | TRUE, FALSE | - |
| respect.unordered.factors | character | ignore | ignore, order, partition | - |
| sample.fraction | numeric | - | |
|
| save.memory | logical | FALSE | TRUE, FALSE | - |
| scale.permutation.importance | logical | FALSE | TRUE, FALSE | - |
| seed | integer | NULL | |
|
| split.select.weights | numeric | - | |
|
| splitrule | character | logrank | logrank, extratrees, C, maxstat | - |
| verbose | logical | TRUE | TRUE, FALSE | - |
| write.forest | logical | TRUE | TRUE, FALSE | - |
| min.bucket | integer | 3 | |
|
| time.interest | integer | NULL | |
|
| node.stats | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvRanger
new()
Creates a new instance of this R6 class.
LearnerSurvRanger$new()
importance()
The importance scores are extracted from the model slot variable.importance.
LearnerSurvRanger$importance()
Named numeric().
oob_error()
The out-of-bag error is extracted from the model slot prediction.error.
LearnerSurvRanger$oob_error()
numeric(1).
clone()
The objects of this class are cloneable with this method.
LearnerSurvRanger$clone(deep = FALSE)
deepWhether to make a deep clone.
be-marc
Wright, N. M, Ziegler, Andreas (2017). “ranger: A Fast Implementation of Random Forests for High Dimensional Data in C++ and R.” Journal of Statistical Software, 77(1), 1–17. doi:10.18637/jss.v077.i01.
Breiman, Leo (2001). “Random Forests.” Machine Learning, 45(1), 5–32. ISSN 1573-0565, doi:10.1023/A:1010933404324.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.ranger", importance = "permutation") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.ranger", importance = "permutation") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Random survival forest.
Calls randomForestSRC::rfsrc() from randomForestSRC.
This learner returns two prediction types:
distr: a survival matrix in two dimensions, where observations are
represented in rows and (unique event) time points in columns.
Calculated using the internal randomForestSRC::predict.rfsrc() function.
crank: the expected mortality using mlr3proba::surv_return().
This Learner can be instantiated via lrn():
lrn("surv.rfsrc")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, randomForestSRC
| Id | Type | Default | Levels | Range |
| ntree | integer | 500 | |
|
| mtry | integer | - | |
|
| mtry.ratio | numeric | - | |
|
| nodesize | integer | 15 | |
|
| nodedepth | integer | - | |
|
| splitrule | character | logrank | logrank, bs.gradient | - |
| nsplit | integer | 10 | |
|
| importance | character | FALSE | FALSE, TRUE, none, anti, permute, random | - |
| block.size | integer | 10 | |
|
| bootstrap | character | by.root | by.root, by.node, none, by.user | - |
| samptype | character | swor | swor, swr | - |
| samp | untyped | - | - | |
| membership | logical | FALSE | TRUE, FALSE | - |
| sampsize | untyped | - | - | |
| sampsize.ratio | numeric | - | |
|
| na.action | character | na.omit | na.omit, na.impute | - |
| nimpute | integer | 1 | |
|
| ntime | integer | 150 | |
|
| proximity | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| distance | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| forest.wt | character | FALSE | FALSE, TRUE, inbag, oob, all | - |
| xvar.wt | untyped | - | - | |
| split.wt | untyped | - | - | |
| forest | logical | TRUE | TRUE, FALSE | - |
| var.used | character | FALSE | FALSE, all.trees | - |
| split.depth | character | FALSE | FALSE, all.trees, by.tree | - |
| seed | integer | - | |
|
| do.trace | logical | FALSE | TRUE, FALSE | - |
| get.tree | untyped | - | - | |
| outcome | character | train | train, test | - |
| ptn.count | integer | 0 | |
|
| estimator | character | nelson | nelson, kaplan | - |
| cores | integer | 1 | |
|
| use.uno | logical | TRUE | TRUE, FALSE | - |
| save.memory | logical | FALSE | TRUE, FALSE | - |
| perf.type | character | - | none | - |
| case.depth | logical | FALSE | TRUE, FALSE | - |
| marginal.xvar | untyped | NULL | - |
estimator: Hidden parameter that controls the type of estimator used to
derive the survival function during prediction. The default value is "chf" which
uses a bootstrapped Nelson-Aalen estimator for the cumulative hazard function
, (Ishwaran, 2008) from which we calculate ,
whereas "surv" uses a bootstrapped Kaplan-Meier estimator to directly estimate
.
mtry: This hyperparameter can alternatively be set via the added
hyperparameter mtry.ratio as mtry = max(ceiling(mtry.ratio * n_features), 1).
Note that mtry and mtry.ratio are mutually exclusive.
sampsize: This hyperparameter can alternatively be set via the added
hyperparameter sampsize.ratio as sampsize = max(ceiling(sampsize.ratio * n_obs), 1).
Note that sampsize and sampsize.ratio are mutually exclusive.
cores: This value is set as the option rf.cores during training and is
set to 1 by default.
ntime: Number of time points to coerce the observed event times for use in the
estimated survival function during prediction. We changed the default value
of 150 to 0 in order to be in line with other random survival forest
learners and use all the unique event times from the train set.
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvRandomForestSRC
new()
Creates a new instance of this R6 class.
LearnerSurvRandomForestSRC$new()
importance()
The importance scores are extracted from the model slot importance.
LearnerSurvRandomForestSRC$importance()
Named numeric().
selected_features()
Selected features are extracted from the model slot var.used.
Note: Due to a known issue in randomForestSRC, enabling var.used = "all.trees"
causes prediction to fail. Therefore, this setting should be used exclusively
for feature selection purposes and not when prediction is required.
LearnerSurvRandomForestSRC$selected_features()
character().
oob_error()
OOB error extracted from the model slot err.rate.
LearnerSurvRandomForestSRC$oob_error()
numeric().
clone()
The objects of this class are cloneable with this method.
LearnerSurvRandomForestSRC$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Ishwaran H, Kogalur UB, Blackstone EH, Lauer MS (2008). “Random survival forests.” The Annals of Applied Statistics, 2(3). doi:10.1214/08-aoas169, https://doi.org/10.1214/08-aoas169.
Breiman, Leo (2001). “Random Forests.” Machine Learning, 45(1), 5–32. ISSN 1573-0565, doi:10.1023/A:1010933404324.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.rfsrc", importance = "TRUE") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.rfsrc", importance = "TRUE") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
Deep neural network survival models from package survdnn, aimed at
tabular (low to moderate-dimensional) covariate settings using torch-based
multilayer perceptrons. The learner wraps survdnn::survdnn().
This learner supports the following prediction types:
lpA numeric vector of linear predictors, one per observation.
For loss "cox" / "cox_l2" this is a log-risk score (higher implies worse prognosis).
For "aft", predict.survdnn() returns the predicted log-time location
(higher implies better prognosis), therefore the learner internally negates it such that higher
values imply higher risk (consistent with mlr3 conventions). For "coxtime",
this is evaluated at a reference time.
cranksame as lp.
distrA survival matrix (rows = observations, columns = time points) based on
predict(type = "survival"). By default, predictions are evaluated on the unique event times
of the training data.
This Learner can be instantiated via lrn():
lrn("surv.survdnn")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, mlr3proba, mlr3extralearners, survdnn, torch
| Id | Type | Default | Levels | Range |
| hidden | untyped | c(32L, 16L) | - | |
| activation | character | relu | relu, leaky_relu, tanh, sigmoid, gelu, elu, softplus | - |
| lr | numeric | 1e-04 | |
|
| epochs | integer | 300 | |
|
| loss | character | cox | cox, cox_l2, aft, coxtime | - |
| optimizer | character | adam | adam, adamw, sgd, rmsprop, adagrad | - |
| optim_args | untyped | list() | - | |
| verbose | logical | FALSE | TRUE, FALSE | - |
| dropout | numeric | 0.3 | |
|
| batch_norm | logical | TRUE | TRUE, FALSE | - |
| callbacks | untyped | NULL | - | |
| .seed | integer | NULL | |
|
| .device | character | auto | auto, cpu, cuda | - |
| na_action | character | omit | omit, fail | - |
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvDNN
marshaled(logical(1))
Whether the learner has been marshaled.
new()
Creates a new instance of this R6 class.
LearnerSurvDNN$new()
marshal()
Marshal the learner's model.
LearnerSurvDNN$marshal(...)
...(any)
Additional arguments passed to mlr3::marshal_model().
unmarshal()
Unmarshal the learner's model.
LearnerSurvDNN$unmarshal(...)
...(any)
Additional arguments passed to mlr3::unmarshal_model().
clone()
The objects of this class are cloneable with this method.
LearnerSurvDNN$clone(deep = FALSE)
deepWhether to make a deep clone.
ielbadisy
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.survdnn", epochs = 42L, loss = "cox") print(learner) # Define the task, split to train/test set task = tsk("lung") set.seed(42) part = partition(task) # Train the learner on the training ids learner$train(task, row_ids = part$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = part$test) print(predictions) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.survdnn", epochs = 42L, loss = "cox") print(learner) # Define the task, split to train/test set task = tsk("lung") set.seed(42) part = partition(task) # Train the learner on the training ids learner$train(task, row_ids = part$train) print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = part$test) print(predictions) # Score the predictions predictions$score()
Survival support vector machine.
Calls survivalsvm::survivalsvm() from survivalsvm.
Four possible SVMs can be implemented, dependent on the type parameter. These correspond
to predicting the survival time via regression (regression), predicting a continuous rank
(vanbelle1, vanbelle2), or a hybrid of the two (hybrid).
Whichever type is chosen determines how the crank predict type is calculated,
but in any case all can be considered a valid continuous ranking.
makediff3 is recommended when using type = "hybrid".
This Learner can be instantiated via lrn():
lrn("surv.svm")
Task type: “surv”
Predict Types: “crank”, “response”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, survivalsvm
| Id | Type | Default | Levels | Range |
| type | character | regression | regression, vanbelle1, vanbelle2, hybrid | - |
| diff.meth | character | - | makediff1, makediff2, makediff3 | - |
| gamma | numeric | NULL | |
|
| mu | numeric | NULL | |
|
| opt.meth | character | quadprog | quadprog, ipop | - |
| kernel | character | lin_kernel | lin_kernel, add_kernel, rbf_kernel, poly_kernel | - |
| kernel.pars | untyped | - | - | |
| sgf.sv | integer | 5 | |
|
| sigf | integer | 7 | |
|
| maxiter | integer | 20 | |
|
| margin | numeric | 0.05 | |
|
| bound | numeric | 10 | |
|
| eig.tol | numeric | 1e-06 | |
|
| conv.tol | numeric | 1e-07 | |
|
| posd.tol | numeric | 1e-08 |
|
This learner returns up to two prediction types:
crank: a vector containing the continuous ranking scores, where each score
corresponds to a specific test observation.
response: the survival time of each test observation, equal to -crank.
This prediction type if only available for "type" equal to regression or hybrid.
gamma, mu have replaced gamma.mu so that it's easier to tune these separately.
mu is only used when type = "hybrid".
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvSVM
new()
Creates a new instance of this R6 class.
LearnerSurvSVM$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvSVM$clone(deep = FALSE)
deepWhether to make a deep clone.
RaphaelS1
Van Belle, Vanya, Pelckmans, Kristiaan, Van Huffel, Sabine, Suykens, AK J (2011). “Improved performance on high-dimensional survival data by application of Survival-SVM.” Bioinformatics, 27(1), 87–94.
Van Belle, Vanya, Pelckmans, Kristiaan, Van Huffel, Sabine, Suykens, AK J (2011). “Support vector methods for survival analysis: a comparison between ranking and regression approaches.” Artificial intelligence in medicine, 53(2), 107–118.
Shivaswamy, K P, Chu, Wei, Jansche, Martin (2007). “A support vector approach to censored targets.” In Seventh IEEE international conference on data mining (ICDM 2007), 655–660. IEEE.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
set.seed(123) # Define the Learner and set parameter values learner = lrn("surv.svm", gamma = 0.1) print(learner) # Define a Task task = tsk("rats") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # print the model print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()set.seed(123) # Define the Learner and set parameter values learner = lrn("surv.svm", gamma = 0.1) print(learner) # Define a Task task = tsk("rats") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) # print the model print(learner$model) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
eXtreme Gradient Boosting regression using an Accelerated Failure Time
objective.
Calls xgboost::xgb.train() from package xgboost with objective
set to survival:aft and eval_metric to aft-nloglik.
This learner returns three prediction types:
response: the estimated survival time for each test observation.
lp: a vector of linear predictors (relative risk scores), one per
observation, estimated as .
Higher survival time denotes lower risk.
crank: same as lp.
Early stopping can be used to find the optimal number of boosting rounds.
The early_stopping_set parameter controls which set is used to monitor the
performance.
By default, early_stopping_set = "none" which disables early stopping.
Set early_stopping_set = "test" to monitor the performance of the model on
the test set while training.
The test set for early stopping can be set with the "test" row role in the
mlr3::Task.
Additionally, the range must be set in which the performance must increase
with early_stopping_rounds and the maximum number of boosting rounds with
nrounds.
While resampling, the test set is automatically applied from the mlr3::Resampling.
Not that using the test set for early stopping can potentially bias the
performance scores.
This Learner can be instantiated via lrn():
lrn("surv.xgboost.aft")
Task type: “surv”
Predict Types: “crank”, “lp”, “response”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, xgboost
| Id | Type | Default | Levels | Range |
| aft_loss_distribution | character | normal | normal, logistic, extreme | - |
| aft_loss_distribution_scale | numeric | - | |
|
| alpha | numeric | 0 | |
|
| base_score | numeric | 0.5 | |
|
| booster | character | gbtree | gbtree, gblinear, dart | - |
| callbacks | untyped | NULL | - | |
| seed | integer | - | |
|
| colsample_bylevel | numeric | 1 | |
|
| colsample_bynode | numeric | 1 | |
|
| colsample_bytree | numeric | 1 | |
|
| disable_default_eval_metric | logical | FALSE | TRUE, FALSE | - |
| evals | untyped | NULL | - | |
| early_stopping_rounds | integer | NULL | |
|
| learning_rate | numeric | 0.3 | |
|
| feature_selector | character | cyclic | cyclic, shuffle, random, greedy, thrifty | - |
| gamma | numeric | 0 | |
|
| grow_policy | character | depthwise | depthwise, lossguide | - |
| interaction_constraints | untyped | - | - | |
| iterationrange | untyped | - | - | |
| lambda | numeric | 1 | |
|
| max_bin | integer | 256 | |
|
| max_delta_step | numeric | 0 | |
|
| max_depth | integer | 6 | |
|
| max_leaves | integer | 0 | |
|
| maximize | logical | NULL | TRUE, FALSE | - |
| min_child_weight | numeric | 1 | |
|
| monotone_constraints | integer | 0 | |
|
| normalize_type | character | tree | tree, forest | - |
| nrounds | integer | - | |
|
| nthread | integer | - | |
|
| num_parallel_tree | integer | 1 | |
|
| one_drop | logical | FALSE | TRUE, FALSE | - |
| print_every_n | integer | 1 | |
|
| rate_drop | numeric | 0 | |
|
| refresh_leaf | logical | TRUE | TRUE, FALSE | - |
| sampling_method | character | uniform | uniform, gradient_based | - |
| sample_type | character | uniform | uniform, weighted | - |
| save_name | untyped | - | - | |
| save_period | integer | - | |
|
| scale_pos_weight | numeric | 1 | |
|
| seed_per_iteration | logical | FALSE | TRUE, FALSE | - |
| skip_drop | numeric | 0 | |
|
| use_rmm | logical | FALSE | TRUE, FALSE | - |
| max_cached_hist_node | integer | NULL | |
|
| max_cat_to_onehot | integer | 4 | |
|
| max_cat_threshold | integer | 64 | |
|
| subsample | numeric | 1 | |
|
| top_k | integer | 0 | |
|
| tree_method | character | auto | auto, exact, approx, hist, gpu_hist | - |
| updater | untyped | - | - | |
| verbose | integer | - | |
|
| verbosity | integer | - | |
|
| xgb_model | untyped | - | - | |
| device | untyped | - | - | |
| missing | numeric | NA | |
|
| validate_features | logical | TRUE | TRUE, FALSE | - |
nrounds is initialized to 1000.
nthread is initialized to 1 to avoid conflicts with parallelization via future.
verbose and verbosity are both initialized to 0.
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvXgboostAFT
internal_valid_scoresThe last observation of the validation scores for all metrics.
Extracted from model$evaluation_log
internal_tuned_valuesReturns the early stopped iterations if early_stopping_rounds was set during training.
validateHow to construct the internal validation data. This parameter can be either NULL,
a ratio, "test", or "predefined".
model(any)
The fitted model. Only available after $train() has been called.
new()
Creates a new instance of this R6 class.
LearnerSurvXgboostAFT$new()
importance()
The importance scores are calculated with xgboost::xgb.importance().
LearnerSurvXgboostAFT$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerSurvXgboostAFT$clone(deep = FALSE)
deepWhether to make a deep clone.
To compute on GPUs, you first need to compile xgboost yourself and link against CUDA. See https://xgboost.readthedocs.io/en/stable/build.html#building-with-gpu-support.
bblodfon
Chen, Tianqi, Guestrin, Carlos (2016). “Xgboost: A scalable tree boosting system.” In Proceedings of the 22nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 785–794. ACM. doi:10.1145/2939672.2939785.
Avinash B, Hyunsu C, Toby H (2022). “Survival Regression with Accelerated Failure Time Model in XGBoost.” Journal of Computational and Graphical Statistics. ISSN 15372715, doi:10.1080/10618600.2022.2067548.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.xgboost.aft") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.xgboost.aft") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()
eXtreme Gradient Boosting regression using a Cox Proportional Hazards
objective.
Calls xgboost::xgb.train() from package xgboost with objective
set to survival:cox and eval_metric to cox-nloglik.
Three types of prediction are returned for this learner:
lp: a vector of linear predictors (relative risk scores), one per
observation.
crank: same as lp.
distr: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
By default, the Breslow estimator is used via mlr3proba::breslow().
nrounds is initialized to 1000.
nthread is initialized to 1 to avoid conflicts with parallelization via future.
verbose and verbosity are both initialized to 0.
This Learner can be instantiated via lrn():
lrn("surv.xgboost.cox")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, xgboost
| Id | Type | Default | Levels | Range |
| alpha | numeric | 0 | |
|
| base_score | numeric | 0.5 | |
|
| booster | character | gbtree | gbtree, gblinear, dart | - |
| callbacks | untyped | list() | - | |
| seed | integer | - | |
|
| colsample_bylevel | numeric | 1 | |
|
| colsample_bynode | numeric | 1 | |
|
| colsample_bytree | numeric | 1 | |
|
| disable_default_eval_metric | logical | FALSE | TRUE, FALSE | - |
| early_stopping_rounds | integer | NULL | |
|
| evals | untyped | NULL | - | |
| learning_rate | numeric | 0.3 | |
|
| feature_selector | character | cyclic | cyclic, shuffle, random, greedy, thrifty | - |
| gamma | numeric | 0 | |
|
| grow_policy | character | depthwise | depthwise, lossguide | - |
| interaction_constraints | untyped | - | - | |
| iterationrange | untyped | - | - | |
| lambda | numeric | 1 | |
|
| max_bin | integer | 256 | |
|
| max_delta_step | numeric | 0 | |
|
| max_depth | integer | 6 | |
|
| max_leaves | integer | 0 | |
|
| maximize | logical | NULL | TRUE, FALSE | - |
| min_child_weight | numeric | 1 | |
|
| monotone_constraints | integer | 0 | |
|
| normalize_type | character | tree | tree, forest | - |
| nrounds | integer | - | |
|
| nthread | integer | - | |
|
| num_parallel_tree | integer | 1 | |
|
| one_drop | logical | FALSE | TRUE, FALSE | - |
| print_every_n | integer | 1 | |
|
| rate_drop | numeric | 0 | |
|
| refresh_leaf | logical | TRUE | TRUE, FALSE | - |
| sampling_method | character | uniform | uniform, gradient_based | - |
| sample_type | character | uniform | uniform, weighted | - |
| save_name | untyped | - | - | |
| save_period | integer | - | |
|
| scale_pos_weight | numeric | 1 | |
|
| seed_per_iteration | logical | FALSE | TRUE, FALSE | - |
| skip_drop | numeric | 0 | |
|
| use_rmm | logical | FALSE | TRUE, FALSE | - |
| max_cached_hist_node | integer | NULL | |
|
| max_cat_to_onehot | integer | 4 | |
|
| max_cat_threshold | integer | 64 | |
|
| subsample | numeric | 1 | |
|
| top_k | integer | 0 | |
|
| tree_method | character | auto | auto, exact, approx, hist, gpu_hist | - |
| updater | untyped | - | - | |
| verbose | integer | - | |
|
| verbosity | integer | - | |
|
| xgb_model | untyped | - | - | |
| device | untyped | - | - | |
| missing | numeric | NA | |
|
| validate_features | logical | TRUE | TRUE, FALSE | - |
Early stopping can be used to find the optimal number of boosting rounds.
The early_stopping_set parameter controls which set is used to monitor the
performance.
By default, early_stopping_set = "none" which disables early stopping.
Set early_stopping_set = "test" to monitor the performance of the model on
the test set while training.
The test set for early stopping can be set with the "test" row role in the
mlr3::Task.
Additionally, the range must be set in which the performance must increase
with early_stopping_rounds and the maximum number of boosting rounds with
nrounds.
While resampling, the test set is automatically applied from the mlr3::Resampling.
Not that using the test set for early stopping can potentially bias the
performance scores.
mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvXgboostCox
internal_valid_scores(named list() or NULL)
Validation metrics extracted from the xgboost model's evaluation_log.
If early stopping is enabled, the scores correspond to the
best_iteration selected by early stopping. Otherwise, the scores are
taken from the final boosting round (nrounds).
internal_tuned_values(named list() or NULL)
If early stopping is activated, this returns a list with the early stopped
iterations (nrounds), which is extracted from the best iteration of the model.
Otherwise NULL.
validateHow to construct the internal validation data.
This parameter can be either NULL, a ratio, "test", or "predefined".
model(any)
The fitted model. Only available after $train() has been called.
new()
Creates a new instance of this R6 class.
LearnerSurvXgboostCox$new()
importance()
The importance scores are calculated with xgboost::xgb.importance().
LearnerSurvXgboostCox$importance()
Named numeric().
clone()
The objects of this class are cloneable with this method.
LearnerSurvXgboostCox$clone(deep = FALSE)
deepWhether to make a deep clone.
To compute on GPUs, you first need to compile xgboost yourself and link against CUDA. See https://xgboost.readthedocs.io/en/stable/build.html#building-with-gpu-support.
bblodfon
Chen, Tianqi, Guestrin, Carlos (2016). “Xgboost: A scalable tree boosting system.” In Proceedings of the 22nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 785–794. ACM. doi:10.1145/2939672.2939785.
as.data.table(mlr_learners) for a table of available Learners in the running session (depending on the loaded packages).
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
# Define the Learner learner = lrn("surv.xgboost.cox") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()# Define the Learner learner = lrn("surv.xgboost.cox") print(learner) # Define a Task task = tsk("grace") # Create train and test set ids = partition(task) # Train the learner on the training ids learner$train(task, row_ids = ids$train) print(learner$model) print(learner$importance()) # Make predictions for the test rows predictions = learner$predict(task, row_ids = ids$test) # Score the predictions predictions$score()