Title: | Extra Learners For mlr3 |
---|---|
Description: | Extra learners for use in mlr3. |
Authors: | Raphael Sonabend [aut] , Patrick Schratz [aut] , Lorenz A. Kapsner [ctb] , Lennart Schneider [ctb] , Stephen A Lauer [ctb] , Pierre Camilleri [ctb], Javier García [ctb], Keenan Ganz [ctb], Byron Jaeger [ctb], Sebastian Fischer [cre, aut], Zezhi Wang [ctb], John Zobolas [ctb] , Lukas Burk [ctb] |
Maintainer: | Sebastian Fischer <[email protected]> |
License: | LGPL-3 |
Version: | 1.0.0 |
Built: | 2024-11-07 11:21:30 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)
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]
John Zobolas [email protected] (ORCID) [contributor]
Lukas Burk [email protected] (ORCID) [contributor]
Helper function to create a template for a learner, as well as the test and parameter test. For more details see the mlr3book.
create_learner( path = ".", classname, type, key = tolower(classname), algorithm, package, caller, feature_types, predict_types, properties, gh_name = "Unknown", label = toproper(algorithm) )
create_learner( path = ".", classname, type, key = tolower(classname), algorithm, package, caller, feature_types, predict_types, properties, gh_name = "Unknown", label = toproper(algorithm) )
path |
( |
classname |
( |
type |
( |
key |
( |
algorithm |
( |
package |
( |
caller |
|
feature_types |
( |
predict_types |
( |
properties |
( |
gh_name |
( |
label |
( |
## Not run: path = tempfile() dir.create(path) create_learner( path = path, classname = "Rpart", type = "classif", key = "rpart", algorithm = "Decision Tree", package = "rpart", caller = "rpart", feature_types = c("logical", "integer", "numeric", "factor", "ordered"), predict_types = c("response", "prob"), properties = c("importance", "missings", "multiclass", "twoclass", "weights"), gh_name = "RaphaelS1", label = "Regression and Partition Tree" ) ## End(Not run)
## Not run: path = tempfile() dir.create(path) create_learner( path = path, classname = "Rpart", type = "classif", key = "rpart", algorithm = "Decision Tree", package = "rpart", caller = "rpart", feature_types = c("logical", "integer", "numeric", "factor", "ordered"), predict_types = c("response", "prob"), properties = c("importance", "missings", "multiclass", "twoclass", "weights"), gh_name = "RaphaelS1", label = "Regression and Partition Tree" ) ## End(Not run)
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)
deep
Whether to make a deep clone.
abess-team
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/basics.html#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 = mlr3::lrn("classif.abess") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.abess") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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()
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
new()
Creates a new instance of this R6 class.
LearnerClassifAdaBoostM1$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifAdaBoostM1$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.AdaBoostM1") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.AdaBoostM1") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 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 | - |
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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.bart") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.bart") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifBayesNet$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifBayesNet$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.bayes_net") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.bayes_net") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
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)
deep
Whether 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_scores
The last observation of the validation scores for all metrics.
Extracted from model$evaluation_log
internal_tuned_values
Returns the early stopped iterations if early_stopping_rounds
was set during training.
validate
How to construct the internal validation data. This parameter can be either NULL
, a ratio, "test"
, or "predefined"
.
new()
Create a LearnerClassifCatboost
object.
LearnerClassifCatboost$new()
importance()
The importance scores are calculated using
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.catboost", iterations = 100) print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.catboost", iterations = 100) print(learner) # Define a Task task = tsk("sonar") # Create train and test set ids = mlr3::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 (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 | - |
offset | untyped | - | - | |
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
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)
deep
Whether 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/basics.html#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("iris") learner = lrn("classif.cforest", ntree = 50) splits = partition(task) learner$train(task, splits$train) pred = learner$predict(task, splits$test)
task = tsk("iris") learner = lrn("classif.cforest", ntree = 50) splits = partition(task) learner$train(task, splits$train) pred = learner$predict(task, splits$test)
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 | - |
offset | untyped | - | - | |
cluster | untyped | - | - | |
scores | untyped | - | - | |
doFit | logical | TRUE | TRUE, FALSE | - |
maxpts | integer | 25000 | |
|
abseps | numeric | 0.001 | |
|
releps | numeric | 0 | |
|
mlr3::Learner
-> mlr3::LearnerClassif
-> LearnerClassifCTree
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.ctree") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.ctree") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifDecisionStump$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifDecisionStump$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.decision_stump") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.decision_stump") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifDecisionTable$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifDecisionTable$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.decision_table") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.decision_table") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.earth") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.earth") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.fnn") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.fnn") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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.
Multiclass classification is not implemented yet.
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.
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 | - | - | |
offset | untyped | NULL | - | |
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 | - |
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() | - | |
outerPIsteps | integer | 0 | |
|
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 | - |
nei | untyped | - | - | |
ncv.threads | integer | 1 | |
|
block.size | integer | 1000 | |
|
unconditional | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner
-> mlr3::LearnerClassif
-> LearnerClassifGam
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)
deep
Whether 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 = mlr3::tsk("spam")$filter(1:1000) l = mlr3::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 = mlr3::tsk("spam")$filter(1:1000) l = mlr3::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 | |
|
offset | numeric | NULL | |
|
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 | - | |
mlr3::Learner
-> mlr3::LearnerClassif
-> LearnerClassifGAMBoost
new()
Create a LearnerClassifGAMBoost
object.
LearnerClassifGAMBoost$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifGAMBoost$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.gamboost") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.gamboost") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.gausspr") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.gausspr") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.gbm") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.gbm") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 |
offset | numeric | NULL | |
|
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 | - | - | |
mlr3::Learner
-> mlr3::LearnerClassif
-> LearnerClassifGLMBoost
new()
Create a LearnerClassifGLMBoost
object.
LearnerClassifGLMBoost$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifGLMBoost$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.glmboost") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.glmboost") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 | |
|
offset | untyped | NULL | - | |
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 | - |
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.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" | - | |
mlr3::Learner
-> mlr3::LearnerClassif
-> LearnerClassifGlmer
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)
deep
Whether 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/basics.html#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)
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
new()
Creates a new instance of this R6 class.
LearnerClassifIBk$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifIBk$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.IBk") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.IBk") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 | - | |
|
cause | 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, by.tree | - |
split.depth | character | FALSE | FALSE, all.trees, by.tree | - |
seed | integer | - | |
|
do.trace | logical | FALSE | TRUE, FALSE | - |
statistics | 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 | - |
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
.
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.imbalanced_rfsrc", importance = "TRUE") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.imbalanced_rfsrc", importance = "TRUE") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifJ48$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifJ48$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.J48") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.J48") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifJRip$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifJRip$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.JRip") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.JRip") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifKStar$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifKStar$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.kstar") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.kstar") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.ksvm") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.ksvm") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.liblinear") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.liblinear") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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_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_scores
The last observation of the validation scores for all metrics.
Extracted from model$evaluation_log
internal_tuned_values
Returns the early stopped iterations if early_stopping_rounds
was set during training.
validate
How to construct the internal validation data. This parameter can be either NULL
, a ratio, "test"
, or "predefined"
.
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.lightgbm") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.lightgbm") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifLMT$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifLMT$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.LMT") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.LMT") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifLogistic$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifLogistic$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.logistic") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.logistic") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.lssvm") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.lssvm") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 { prob_vector_to_matrix(p, levs) } } 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 { prob_vector_to_matrix(p, levs) } } 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
new()
Creates a new instance of this R6 class.
LearnerClassifMultilayerPerceptron$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifMultilayerPerceptron$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.multilayer_perceptron") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.multilayer_perceptron") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifNaiveBayesMultinomial$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifNaiveBayesMultinomial$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.naive_bayes_multinomial") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.naive_bayes_multinomial") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifNaiveBayesWeka$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifNaiveBayesWeka$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.naive_bayes_weka") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.naive_bayes_weka") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifOneR$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifOneR$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.OneR") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.OneR") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifPART$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifPART$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.PART") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.PART") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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.
family
is set to "binomial"
and canno 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)
deep
Whether 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/basics.html#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
new()
Creates a new instance of this R6 class.
LearnerClassifRandomForestWeka$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifRandomForestWeka$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.random_forest_weka") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.random_forest_weka") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifRandomTree$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifRandomTree$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.random_tree") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.random_tree") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.randomForest", importance = "accuracy") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.randomForest", importance = "accuracy") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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("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
new()
Creates a new instance of this R6 class.
LearnerClassifREPTree$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifREPTree$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.reptree") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.reptree") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 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 | |
|
ntime | integer | - | |
|
cause | 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, by.tree | - |
split.depth | character | FALSE | FALSE, all.trees, by.tree | - |
seed | integer | - | |
|
do.trace | logical | FALSE | TRUE, FALSE | - |
statistics | 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 | - |
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
.
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.rfsrc", importance = "TRUE") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.rfsrc", importance = "TRUE") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 Planted Forest: A directly interpretable tree ensemble.
Calls randomPlantedForest::rpf()
from 'randomPlantedForest'.
loss
:
Actual default: "L2"
.
Initial value: "exponential"
.
Reason for change: Using "L2"
(or "L1"
) loss does not guarantee predictions are valid
probabilities and more akin to the linear predictor of a GLM.
max_interaction
:
This hyperparameter can alternatively be set via max_interaction_ratio
as
max_interaction = max(ceiling(max_interaction_ratio * n_features), 1)
.
The parameter max_interaction_limit
can optionally be set as an upper bound, such that
max_interaction_ratio * min(n_features, max_interaction_limit)
is used instead.
This is analogous to mtry.ratio
in classif.ranger
, with
max_interaction_limit
as an additional constraint.
The parameter max_interaction_limit
is initialized to Inf
.
This Learner can be instantiated via lrn():
lrn("classif.rpf")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, randomPlantedForest
Id | Type | Default | Levels | Range |
max_interaction | integer | 1 | |
|
max_interaction_ratio | numeric | - | |
|
max_interaction_limit | integer | - | |
|
ntrees | integer | 50 | |
|
splits | integer | 30 | |
|
split_try | integer | 10 | |
|
t_try | numeric | 0.4 | |
|
loss | character | L2 | L1, L2, logit, exponential | - |
delta | numeric | 1 | |
|
epsilon | numeric | 0.1 | |
|
deterministic | logical | FALSE | TRUE, FALSE | - |
nthreads | integer | 1 | |
|
cv | logical | FALSE | TRUE, FALSE | - |
purify | logical | FALSE | TRUE, FALSE | - |
Package 'randomPlantedForest' is not on CRAN and has to be installed from GitHub via
remotes::install_github("PlantedML/randomPlantedForest")
.
mlr3::Learner
-> mlr3::LearnerClassif
-> LearnerClassifRandomPlantedForest
new()
Creates a new instance of this R6 class.
LearnerClassifRandomPlantedForest$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifRandomPlantedForest$clone(deep = FALSE)
deep
Whether to make a deep clone.
jemus42
Hiabu, Munir, Mammen, Enno, Meyer, T. J (2023). “Random Planted Forest: a directly interpretable tree ensemble.” arXiv preprint arXiv:2012.14563. doi:10.48550/ARXIV.2012.14563.
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/basics.html#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 = mlr3::lrn("classif.rpf") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.rpf") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifSGD$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifSGD$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.sgd") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.sgd") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifSimpleLogistic$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifSimpleLogistic$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.simple_logistic") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.simple_logistic") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerClassifSMO$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifSMO$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.smo") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.smo") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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()
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
new()
Creates a new instance of this R6 class.
LearnerClassifVotedPerceptron$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifVotedPerceptron$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("classif.voted_perceptron") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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 = mlr3::lrn("classif.voted_perceptron") print(learner) # Define a Task task = mlr3::tsk("sonar") # Create train and test set ids = mlr3::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()
Kernel density estimator.
Calls ks::kde()
from ks.
This Learner can be instantiated via lrn():
lrn("dens.kde_ks")
Task type: “dens”
Predict Types: “pdf”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, ks
Id | Type | Default | Levels | Range |
h | numeric | - | |
|
H | untyped | - | - | |
gridsize | untyped | - | - | |
gridtype | untyped | - | - | |
xmin | numeric | - | |
|
xmax | numeric | - | |
|
supp | numeric | 3.7 | |
|
binned | numeric | - | |
|
bgridsize | untyped | - | - | |
positive | logical | FALSE | TRUE, FALSE | - |
adj.positive | untyped | - | - | |
w | untyped | - | - | |
compute.cont | logical | TRUE | TRUE, FALSE | - |
approx.cont | logical | TRUE | TRUE, FALSE | - |
unit.interval | logical | FALSE | TRUE, FALSE | - |
verbose | logical | FALSE | TRUE, FALSE | - |
density | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner
-> mlr3proba::LearnerDens
-> LearnerDensKDEks
new()
Creates a new instance of this R6 class.
LearnerDensKDEks$new()
clone()
The objects of this class are cloneable with this method.
LearnerDensKDEks$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Gramacki, Artur, Gramacki, Jarosław (2017). “FFT-based fast computation of multivariate kernel density estimators with unconstrained bandwidth matrices.” Journal of Computational and Graphical Statistics, 26(2), 459–462.
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/basics.html#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 = mlr3::lrn("dens.kde_ks") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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 = mlr3::lrn("dens.kde_ks") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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 density estimation.
Calls locfit::density.lf()
from locfit.
This Learner can be instantiated via lrn():
lrn("dens.locfit")
Task type: “dens”
Predict Types: “pdf”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, locfit
Id | Type | Default | Levels | Range |
window | character | gaus | tcub, rect, trwt, tria, epan, bisq, gaus | - |
width | numeric | - | |
|
from | numeric | - | |
|
to | numeric | - | |
|
cut | numeric | - | |
|
deg | numeric | 0 | |
|
link | character | ident | ident, log, logit, inverse, sqrt, arcsin | - |
kern | character | tcub | rect, trwt, tria, epan, bisq, gauss, tcub | - |
kt | character | sph | sph, prod | - |
renorm | logical | FALSE | TRUE, FALSE | - |
maxk | integer | 100 | |
|
itype | character | - | prod, mult, mlin, haz | - |
mint | integer | 20 | |
|
maxit | integer | 20 | |
|
mlr3::Learner
-> mlr3proba::LearnerDens
-> LearnerDensLocfit
new()
Creates a new instance of this R6 class.
LearnerDensLocfit$new()
clone()
The objects of this class are cloneable with this method.
LearnerDensLocfit$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Loader, Clive (2006). Local regression and likelihood. Springer Science & Business Media.
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/basics.html#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 = mlr3::lrn("dens.locfit") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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 = mlr3::lrn("dens.locfit") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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()
Density logspline learner.
Calls logspline::logspline()
from logspline.
This Learner can be instantiated via lrn():
lrn("dens.logspline")
Task type: “dens”
Predict Types: “pdf”, “cdf”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, logspline
Id | Type | Default | Levels | Range |
lbound | numeric | - | |
|
ubound | numeric | - | |
|
maxknots | numeric | 0 | |
|
knots | untyped | - | - | |
nknots | numeric | 0 | |
|
penalty | untyped | - | - | |
silent | logical | TRUE | TRUE, FALSE | - |
mind | numeric | -1 | |
|
error.action | integer | 2 | |
|
mlr3::Learner
-> mlr3proba::LearnerDens
-> LearnerDensLogspline
new()
Creates a new instance of this R6 class.
LearnerDensLogspline$new()
clone()
The objects of this class are cloneable with this method.
LearnerDensLogspline$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Kooperberg, Charles, Stone, J C (1992). “Logspline density estimation for censored data.” Journal of Computational and Graphical Statistics, 1(4), 301–328.
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/basics.html#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 = mlr3::lrn("dens.logspline") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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 = mlr3::lrn("dens.logspline") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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()
Density estimator for discrete and continuous variables.
Calls np::npudens()
from np.
This Learner can be instantiated via lrn():
lrn("dens.mixed")
Task type: “dens”
Predict Types: “pdf”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, np
Id | Type | Default | Levels | Range |
bws | untyped | - | - | |
ckertype | character | gaussian | gaussian, epanechnikov, uniform | - |
bwscaling | logical | FALSE | TRUE, FALSE | - |
bwmethod | character | cv.ml | cv.ml, cv.ls, normal-reference | - |
bwtype | character | fixed | fixed, generalized_nn, adaptive_nn | - |
bandwidth.compute | logical | FALSE | TRUE, FALSE | - |
ckerorder | integer | 2 | |
|
remin | logical | TRUE | TRUE, FALSE | - |
itmax | integer | 10000 | |
|
nmulti | integer | - | |
|
ftol | numeric | 1.490116e-07 | |
|
tol | numeric | 0.0001490116 | |
|
small | numeric | 1.490116e-05 | |
|
lbc.dir | numeric | 0.5 | |
|
dfc.dir | numeric | 0.5 | |
|
cfac.dir | untyped | 2.5 * (3 - sqrt(5)) | - | |
initc.dir | numeric | 1 | |
|
lbd.dir | numeric | 0.1 | |
|
hbd.dir | numeric | 1 | |
|
dfac.dir | untyped | 0.25 * (3 - sqrt(5)) | - | |
initd.dir | numeric | 1 | |
|
lbc.init | numeric | 0.1 | |
|
hbc.init | numeric | 2 | |
|
cfac.init | numeric | 0.5 | |
|
lbd.init | numeric | 0.1 | |
|
hbd.init | numeric | 0.9 | |
|
dfac.init | numeric | 0.37 | |
|
ukertype | character | - | aitchisonaitken, liracine | - |
okertype | character | - | wangvanryzin, liracine | - |
mlr3::Learner
-> mlr3proba::LearnerDens
-> LearnerDensMixed
new()
Creates a new instance of this R6 class.
LearnerDensMixed$new()
clone()
The objects of this class are cloneable with this method.
LearnerDensMixed$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Li, Qi, Racine, Jeff (2003). “Nonparametric estimation of distributions with categorical and continuous data.” journal of multivariate analysis, 86(2), 266–292.
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/basics.html#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 = mlr3::lrn("dens.mixed") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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 = mlr3::lrn("dens.mixed") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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()
Nonparametric density estimation.
Calls sm::sm.density()
from sm.
This Learner can be instantiated via lrn():
lrn("dens.nonpar")
Task type: “dens”
Predict Types: “pdf”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, sm
Id | Type | Default | Levels | Range |
h | numeric | - | |
|
group | untyped | - | - | |
delta | numeric | - | |
|
h.weights | numeric | 1 | |
|
hmult | untyped | 1 | - | |
method | character | normal | normal, cv, sj, df, aicc | - |
positive | logical | FALSE | TRUE, FALSE | - |
verbose | untyped | 1 | - | |
mlr3::Learner
-> mlr3proba::LearnerDens
-> LearnerDensNonparametric
new()
Creates a new instance of this R6 class.
LearnerDensNonparametric$new()
clone()
The objects of this class are cloneable with this method.
LearnerDensNonparametric$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Bowman, A.W., Azzalini, A. (1997). Applied Smoothing Techniques for Data Analysis: The Kernel Approach with S-Plus Illustrations, series Oxford Statistical Science Series. OUP Oxford. ISBN 9780191545696, https://books.google.de/books?id=7WBMrZ9umRYC.
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/basics.html#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 = mlr3::lrn("dens.nonpar") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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 = mlr3::lrn("dens.nonpar") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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()
Density estimation using penalized B-splines with automatic selection of smoothing parameter.
Calls pendensity::pendensity()
from pendensity.
This Learner can be instantiated via lrn():
lrn("dens.pen")
Task type: “dens”
Predict Types: “pdf”, “cdf”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, pendensity
Id | Type | Default | Levels | Range |
base | character | bspline | bspline, gaussian | - |
no.base | numeric | 41 | |
|
max.iter | numeric | 20 | |
|
lambda0 | numeric | 500 | |
|
q | numeric | 3 | |
|
sort | logical | TRUE | TRUE, FALSE | - |
with.border | untyped | - | - | |
m | numeric | 3 | |
|
eps | numeric | 0.01 | |
|
mlr3::Learner
-> mlr3proba::LearnerDens
-> LearnerDensPenalized
new()
Creates a new instance of this R6 class.
LearnerDensPenalized$new()
clone()
The objects of this class are cloneable with this method.
LearnerDensPenalized$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Schellhase, Christian, Kauermann, Göran (2012). “Density estimation and comparison with a penalized mixture approach.” Computational Statistics, 27(4), 757–777.
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/basics.html#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 = mlr3::lrn("dens.pen") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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 = mlr3::lrn("dens.pen") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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()
Kernel density estimation with global bandwidth selection via "plug-in".
Calls plugdensity::plugin.density()
from plugdensity.
This Learner can be instantiated via lrn():
lrn("dens.plug")
Task type: “dens”
Predict Types: “pdf”
Feature Types: “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, plugdensity
Id | Type | Default | Levels |
na.rm | logical | FALSE | TRUE, FALSE |
mlr3::Learner
-> mlr3proba::LearnerDens
-> LearnerDensPlugin
new()
Creates a new instance of this R6 class.
LearnerDensPlugin$new()
clone()
The objects of this class are cloneable with this method.
LearnerDensPlugin$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Engel, Joachim, Herrmann, Eva, Gasser, Theo (1994). “An iterative bandwidth selector for kernel estimation of densities and their derivatives.” Journaltitle of Nonparametric Statistics, 4(1), 21–34.
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/basics.html#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 = mlr3::lrn("dens.plug") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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 = mlr3::lrn("dens.plug") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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()
Density Smoothing Splines Learner.
Calls gss::ssden()
from gss.
This Learner can be instantiated via lrn():
lrn("dens.spline")
Task type: “dens”
Predict Types: “pdf”, “cdf”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, gss
Id | Type | Default | Levels | Range |
type | untyped | - | - | |
alpha | numeric | 1.4 | |
|
weights | untyped | - | - | |
na.action | untyped | stats::na.omit | - | |
id.basis | untyped | - | - | |
nbasis | integer | - | |
|
seed | numeric | - | |
|
domain | untyped | - | - | |
quad | untyped | - | - | |
qdsz.depth | numeric | - | |
|
bias | untyped | - | - | |
prec | numeric | 1e-07 | |
|
maxiter | integer | 30 | |
|
skip.iter | logical | - | TRUE, FALSE | - |
mlr3::Learner
-> mlr3proba::LearnerDens
-> LearnerDensSpline
new()
Creates a new instance of this R6 class.
LearnerDensSpline$new()
clone()
The objects of this class are cloneable with this method.
LearnerDensSpline$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Gu, Chong, Wang, Jingyuan (2003). “Penalized likelihood density estimation: Direct cross-validation and scalable approximation.” Statistica Sinica, 811–826.
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/basics.html#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 = mlr3::lrn("dens.spline") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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 = mlr3::lrn("dens.spline") print(learner) # Define a Task task = mlr3::tsk("faithful") # Create train and test set ids = mlr3::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()
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)
deep
Whether to make a deep clone.
abess-team
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/basics.html#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 = mlr3::lrn("regr.abess") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.abess") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 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 | - |
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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.bart") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.bart") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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_scores
The last observation of the validation scores for all metrics.
Extracted from model$evaluation_log
internal_tuned_values
Returns the early stopped iterations if early_stopping_rounds
was set during training.
validate
How to construct the internal validation data. This parameter can be either NULL
, a ratio, "test"
, or "predefined"
.
new()
Create a LearnerRegrCatboost
object.
LearnerRegrCatboost$new()
importance()
The importance scores are calculated using
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.catboost") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.catboost") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 (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 | - |
offset | untyped | - | - | |
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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.cforest") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.cforest") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 | - |
offset | untyped | - | - | |
cluster | untyped | - | - | |
scores | untyped | - | - | |
doFit | logical | TRUE | TRUE, FALSE | - |
maxpts | integer | 25000 | |
|
abseps | numeric | 0.001 | |
|
releps | numeric | 0 | |
|
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrCTree
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.ctree") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.ctree") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 | - | |
|
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrCubist
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.cubist") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.cubist") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerRegrDecisionStump$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrDecisionStump$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.decision_stump") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.decision_stump") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerRegrDecisionTable$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrDecisionTable$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.decision_table") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.decision_table") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.earth") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.earth") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.fnn") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.fnn") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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.
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 | - | - | |
offset | untyped | NULL | - | |
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 | - |
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() | - | |
outerPIsteps | integer | 0 | |
|
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 | - |
nei | untyped | - | - | |
ncv.threads | integer | 1 | |
|
edge.correct | logical | FALSE | TRUE, FALSE | - |
block.size | integer | 1000 | |
|
unconditional | logical | FALSE | TRUE, FALSE | - |
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrGam
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)
deep
Whether 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 = mlr3::tsk("mtcars") l = mlr3::lrn("regr.gam") l$param_set$values$formula = mpg ~ cyl + am + s(disp) + s(hp) l$train(t) l$model
# simple example t = mlr3::tsk("mtcars") l = mlr3::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 | |
|
offset | numeric | NULL | |
|
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 | - | |
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrGAMBoost
new()
Create a LearnerRegrGAMBoost
object.
LearnerRegrGAMBoost$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrGAMBoost$clone(deep = FALSE)
deep
Whether 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/basics.html#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.gamboost", baselearner = "bols") print(learner)
# Define the Learner learner = lrn("regr.gamboost", baselearner = "bols") print(learner)
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
new()
Creates a new instance of this R6 class.
LearnerRegrGaussianProcesses$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrGaussianProcesses$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.gaussian_processes") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.gaussian_processes") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.gausspr") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.gausspr") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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.gbm") print(learner)
# Define the Learner learner = lrn("regr.gbm") print(learner)
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 | - | |
offset | untyped | - | - | |
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 | - |
type
Actual default: "link"
Adjusted default: "response"
Reason for change: Response scale more natural for predictions.
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrGlm
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.glm") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.glm") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 |
offset | numeric | NULL | |
|
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 | - | - | |
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrGLMBoost
new()
Create a LearnerRegrGLMBoost
object.
LearnerRegrGLMBoost$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrGLMBoost$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.glmboost") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.glmboost") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerRegrIBk$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrIBk$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.IBk") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.IBk") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerRegrKStar$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrKStar$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.kstar") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.kstar") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.ksvm") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.ksvm") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 th default of the respective
"type".
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrLiblineaR
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.liblinear") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.liblinear") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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_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_scores
The last observation of the validation scores for all metrics.
Extracted from model$evaluation_log
internal_tuned_values
Returns the early stopped iterations if early_stopping_rounds
was set during training.
validate
How to construct the internal validation data.
This parameter can be either NULL
, a ratio, "test"
, or "predefined"
.
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.lightgbm") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.lightgbm") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerRegrLinearRegression$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrLinearRegression$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.linear_regression") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.linear_regression") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 | |
|
offset | untyped | NULL | - | |
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 | - |
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.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" | - | |
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrLmer
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)
deep
Whether 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/basics.html#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 = cmedv ~ (1 | town)) # Define a Task task = tsk("boston_housing") learner$train(task) print(learner$model)
# Define the Learner and set parameter values learner = lrn("regr.lmer", formula = cmedv ~ (1 | town)) # Define a Task task = tsk("boston_housing") 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
new()
Creates a new instance of this R6 class.
LearnerRegrM5P$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrM5P$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.m5p") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.m5p") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerRegrM5Rules$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrM5Rules$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.M5Rules") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.M5Rules") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.mars") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.mars") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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)
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
new()
Creates a new instance of this R6 class.
LearnerRegrMultilayerPerceptron$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrMultilayerPerceptron$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.multilayer_perceptron") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.multilayer_perceptron") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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.
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)
deep
Whether 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/basics.html#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 = mlr3::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 = mlr3::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()
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
new()
Creates a new instance of this R6 class.
LearnerRegrRandomForestWeka$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrRandomForestWeka$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.random_forest_weka") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.random_forest_weka") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerRegrRandomTree$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrRandomTree$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.random_tree") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.random_tree") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.randomForest", importance = "mse") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.randomForest", importance = "mse") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerRegrREPTree$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrREPTree$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.reptree") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.reptree") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 | |
|
ntime | integer | - | |
|
cause | 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, by.tree | - |
split.depth | character | FALSE | FALSE, all.trees, by.tree | - |
seed | integer | - | |
|
do.trace | logical | FALSE | TRUE, FALSE | - |
statistics | 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 | - |
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
.
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.rfsrc", importance = "TRUE") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.rfsrc", importance = "TRUE") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 Planted Forest: A directly interpretable tree ensemble.
Calls randomPlantedForest::rpf()
from 'randomPlantedForest'.
This Learner can be instantiated via lrn():
lrn("regr.rpf")
Task type: “regr”
Predict Types: “response”
Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”
Required Packages: mlr3, randomPlantedForest
Id | Type | Default | Levels | Range |
max_interaction | integer | 1 | |
|
max_interaction_ratio | numeric | - | |
|
max_interaction_limit | integer | - | |
|
ntrees | integer | 50 | |
|
splits | integer | 30 | |
|
split_try | integer | 10 | |
|
t_try | numeric | 0.4 | |
|
deterministic | logical | FALSE | TRUE, FALSE | - |
nthreads | integer | 1 | |
|
cv | logical | FALSE | TRUE, FALSE | - |
purify | logical | FALSE | TRUE, FALSE | - |
max_interaction
:
This hyperparameter can alternatively be set via max_interaction_ratio
as
max_interaction = max(ceiling(max_interaction_ratio * n_features), 1)
.
The parameter max_interaction_limit
can optionally be set as an upper bound, such that
max_interaction_ratio * min(n_features, max_interaction_limit)
is used instead.
This is analogous to mtry.ratio
in classif.ranger
, with
max_interaction_limit
as an additional constraint.
The parameter max_interaction_limit
is initialized to Inf
.
Package 'randomPlantedForest' is not on CRAN and has to be installed from GitHub via
remotes::install_github("PlantedML/randomPlantedForest")
.
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrRandomPlantedForest
new()
Creates a new instance of this R6 class.
LearnerRegrRandomPlantedForest$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrRandomPlantedForest$clone(deep = FALSE)
deep
Whether to make a deep clone.
jemus42
Hiabu, Munir, Mammen, Enno, Meyer, T. J (2023). “Random Planted Forest: a directly interpretable tree ensemble.” arXiv preprint arXiv:2012.14563. doi:10.48550/ARXIV.2012.14563.
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/basics.html#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 = mlr3::lrn("regr.rpf") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.rpf") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.rsm") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.rsm") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.rvm") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.rvm") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerRegrSGD$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrSGD$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.sgd") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.sgd") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerRegrSimpleLinearRegression$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrSimpleLinearRegression$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.simple_linear_regression") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.simple_linear_regression") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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
new()
Creates a new instance of this R6 class.
LearnerRegrSMOreg$new()
clone()
The objects of this class are cloneable with this method.
LearnerRegrSMOreg$clone(deep = FALSE)
deep
Whether 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/basics.html#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 = mlr3::lrn("regr.smo_reg") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 = mlr3::lrn("regr.smo_reg") print(learner) # Define a Task task = mlr3::tsk("mtcars") # Create train and test set ids = mlr3::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 akritas estimator.
Calls survivalmodels::akritas()
from package 'survivalmodels'.
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 survivalmodels::predict.akritas()
function.
The survival matrix uses the unique time points from the training set.
We advise to set the parameter ntime
which allows to adjust the granularity
of these time points to a reasonable number (e.g. 150
).
This avoids large execution times during prediction.
crank
: the expected mortality using survivalmodels::surv_to_risk()
.
This Learner can be instantiated via lrn():
lrn("surv.akritas")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, survivalmodels, distr6
Id | Type | Default | Levels | Range |
lambda | numeric | 0.5 | |
|
reverse | logical | FALSE | TRUE, FALSE | - |
ntime | integer | NULL | |
|
round_time | integer | 2 | |
|
Package 'survivalmodels' is not on CRAN and has to be install from GitHub via
remotes::install_github("RaphaelS1/survivalmodels")
.
mlr3::Learner
-> mlr3proba::LearnerSurv
-> LearnerSurvAkritas
new()
Creates a new instance of this R6 class.
LearnerSurvAkritas$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvAkritas$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Akritas, G M (1994). “Nearest neighbor estimation of a bivariate distribution under random censoring.” The Annals of Statistics, 1299–1327.
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/basics.html#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 = mlr3::lrn("surv.akritas") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.akritas") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 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, pracma
Id | Type | Default | Levels | Range |
n_tree | integer | 500 | |
|
n_split | integer | 5 | |
|
n_retry | integer | 3 | |
|
n_thread | integer | 0 | |
|
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 | - |
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, omit, 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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.aorsf") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.aorsf") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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)
deep
Whether 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/basics.html#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, pracma
Id | Type | Default | Levels | Range |
family | character | coxph | coxph, weibull, loglog, lognormal, gehan, cindex, custom | - |
custom.family | untyped | - | - | |
nuirange | untyped | c(0, 100) | - | |
offset | untyped | - | - | |
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 | - | |
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.blackboost") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.blackboost") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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()
A random forest based on conditional inference trees (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
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 | - |
offset | untyped | - | - | |
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)
deep
Whether 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/basics.html#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") learner = lrn("surv.cforest", ntree = 50) splits = partition(task) learner$train(task, splits$train) pred = learner$predict(task, splits$test)
task = tsk("rats") learner = lrn("surv.cforest", ntree = 50) splits = partition(task) learner$train(task, splits$train) pred = learner$predict(task, splits$test)
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, pracma
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 | - | - | |
The package 'CoxBoost' is not on CRAN and has to be installed from GitHub using
remotes::install_github("binderh/CoxBoost")
.
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)
deep
Whether to make a deep clone.
RaphaelS1
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/basics.html#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 = mlr3::lrn("surv.coxboost") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.coxboost") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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()
Cox-Time survival model.
Calls survivalmodels::coxtime()
from package 'survivalmodels'.
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 survivalmodels::predict.pycox()
function.
crank
: the expected mortality using survivalmodels::surv_to_risk()
.
This Learner can be instantiated via lrn():
lrn("surv.coxtime")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, survivalmodels, distr6, reticulate
Id | Type | Default | Levels | Range |
frac | numeric | 0 | |
|
standardize_time | logical | FALSE | TRUE, FALSE | - |
log_duration | logical | FALSE | TRUE, FALSE | - |
with_mean | logical | TRUE | TRUE, FALSE | - |
with_std | logical | TRUE | TRUE, FALSE | - |
num_nodes | untyped | c(32L, 32L) | - | |
batch_norm | logical | TRUE | TRUE, FALSE | - |
dropout | numeric | - | |
|
activation | character | relu | celu, elu, gelu, glu, hardshrink, hardsigmoid, hardswish, hardtanh, relu6, leakyrelu, ... | - |
device | untyped | - | - | |
shrink | numeric | 0 | |
|
optimizer | character | adam | adadelta, adagrad, adam, adamax, adamw, asgd, rmsprop, rprop, sgd, sparse_adam | - |
rho | numeric | 0.9 | |
|
eps | numeric | 1e-08 | |
|
lr | numeric | 1 | |
|
weight_decay | numeric | 0 | |
|
learning_rate | numeric | 0.01 | |
|
lr_decay | numeric | 0 | |
|
betas | untyped | c(0.9, 0.999) | - | |
amsgrad | logical | FALSE | TRUE, FALSE | - |
lambd | numeric | 1e-04 | |
|
alpha | numeric | 0.75 | |
|
t0 | numeric | 1e+06 | |
|
momentum | numeric | 0 | |
|
centered | logical | TRUE | TRUE, FALSE | - |
etas | untyped | c(0.5, 1.2) | - | |
step_sizes | untyped | c(1e-06, 50) | - | |
dampening | numeric | 0 | |
|
nesterov | logical | FALSE | TRUE, FALSE | - |
batch_size | integer | 256 | |
|
epochs | integer | 1 | |
|
verbose | logical | TRUE | TRUE, FALSE | - |
num_workers | integer | 0 | |
|
shuffle | logical | TRUE | TRUE, FALSE | - |
best_weights | logical | FALSE | TRUE, FALSE | - |
early_stopping | logical | FALSE | TRUE, FALSE | - |
min_delta | numeric | 0 | |
|
patience | integer | 10 | |
|
Package 'survivalmodels' is not on CRAN and has to be install from GitHub via
remotes::install_github("RaphaelS1/survivalmodels")
.
mlr3::Learner
-> mlr3proba::LearnerSurv
-> LearnerSurvCoxtime
new()
Creates a new instance of this R6 class.
LearnerSurvCoxtime$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvCoxtime$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Kvamme, Håvard, Borgan Ø, Scheel I (2019). “Time-to-event prediction with neural networks and Cox regression.” arXiv preprint arXiv:1907.00825.
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/basics.html#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.coxtime")
lrn("surv.coxtime")
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
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 | - |
offset | untyped | - | - | |
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.ctree") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.ctree") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 to be used in CoxBoost::cv.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, pracma
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 | - | - | |
The package 'CoxBoost' is not on CRAN and has to be installed from GitHub using
remotes::install_github("binderh/CoxBoost")
.
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)
deep
Whether to make a deep clone.
RaphaelS1
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/basics.html#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 | |
|
offset | untyped | NULL | - | |
newoffset | untyped | - | - | |
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 | - | |
|
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.cv_glmnet") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.cv_glmnet") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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()
Neural network 'Deephit' for survival analysis.
Calls survivalmodels::deephit()
from pacakge 'survivalmodels'.
Custom nets can be used in this learner either using the
survivalmodels::build_pytorch_net utility function or using torch
via reticulate.
The number of output channels depends on the number of discretised time-points, i.e.
the parameters cuts
or cutpoints
.
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 survivalmodels::predict.pycox()
function.
crank
: the expected mortality using survivalmodels::surv_to_risk()
.
This Learner can be instantiated via lrn():
lrn("surv.deephit")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, survivalmodels, distr6, reticulate
Id | Type | Default | Levels | Range |
frac | numeric | 0 | |
|
cuts | integer | 10 | |
|
cutpoints | untyped | - | - | |
scheme | character | equidistant | equidistant, quantiles | - |
cut_min | numeric | 0 | |
|
num_nodes | untyped | c(32L, 32L) | - | |
batch_norm | logical | TRUE | TRUE, FALSE | - |
dropout | numeric | - | |
|
activation | character | relu | celu, elu, gelu, glu, hardshrink, hardsigmoid, hardswish, hardtanh, relu6, leakyrelu, ... | - |
custom_net | untyped | - | - | |
device | untyped | - | - | |
mod_alpha | numeric | 0.2 | |
|
sigma | numeric | 0.1 | |
|
optimizer | character | adam | adadelta, adagrad, adam, adamax, adamw, asgd, rmsprop, rprop, sgd, sparse_adam | - |
rho | numeric | 0.9 | |
|
eps | numeric | 1e-08 | |
|
lr | numeric | 1 | |
|
weight_decay | numeric | 0 | |
|
learning_rate | numeric | 0.01 | |
|
lr_decay | numeric | 0 | |
|
betas | untyped | c(0.9, 0.999) | - | |
amsgrad | logical | FALSE | TRUE, FALSE | - |
lambd | numeric | 1e-04 | |
|
alpha | numeric | 0.75 | |
|
t0 | numeric | 1e+06 | |
|
momentum | numeric | 0 | |
|
centered | logical | TRUE | TRUE, FALSE | - |
etas | untyped | c(0.5, 1.2) | - | |
step_sizes | untyped | c(1e-06, 50) | - | |
dampening | numeric | 0 | |
|
nesterov | logical | FALSE | TRUE, FALSE | - |
batch_size | integer | 256 | |
|
epochs | integer | 1 | |
|
verbose | logical | TRUE | TRUE, FALSE | - |
num_workers | integer | 0 | |
|
shuffle | logical | TRUE | TRUE, FALSE | - |
best_weights | logical | FALSE | TRUE, FALSE | - |
early_stopping | logical | FALSE | TRUE, FALSE | - |
min_delta | numeric | 0 | |
|
patience | integer | 10 | |
|
interpolate | logical | FALSE | TRUE, FALSE | - |
inter_scheme | character | const_hazard | const_hazard, const_pdf | - |
sub | integer | 10 | |
|
Package 'survivalmodels' is not on CRAN and has to be install from GitHub via
remotes::install_github("RaphaelS1/survivalmodels")
.
mlr3::Learner
-> mlr3proba::LearnerSurv
-> LearnerSurvDeephit
new()
Creates a new instance of this R6 class.
LearnerSurvDeephit$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvDeephit$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Lee, Changhee, Zame, William, Yoon, Jinsung, Van Der Schaar, Mihaela (2018). “Deephit: A deep learning approach to survival analysis with competing risks.” In Proceedings of the AAAI conference on artificial intelligence, volume 32 number 1.
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/basics.html#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.deephit")
lrn("surv.deephit")
DeepSurv fits a neural network based on the partial likelihood from a Cox PH.
Calls survivalmodels::deepsurv()
from package 'survivalmodels'.
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 survivalmodels::predict.pycox()
function.
crank
: the expected mortality using survivalmodels::surv_to_risk()
.
This Learner can be instantiated via lrn():
lrn("surv.deepsurv")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, survivalmodels, distr6, reticulate
Id | Type | Default | Levels | Range |
frac | numeric | 0 | |
|
num_nodes | untyped | c(32L, 32L) | - | |
batch_norm | logical | TRUE | TRUE, FALSE | - |
dropout | numeric | - | |
|
activation | character | relu | celu, elu, gelu, glu, hardshrink, hardsigmoid, hardswish, hardtanh, relu6, leakyrelu, ... | - |
device | untyped | - | - | |
optimizer | character | adam | adadelta, adagrad, adam, adamax, adamw, asgd, rmsprop, rprop, sgd, sparse_adam | - |
rho | numeric | 0.9 | |
|
eps | numeric | 1e-08 | |
|
lr | numeric | 1 | |
|
weight_decay | numeric | 0 | |
|
learning_rate | numeric | 0.01 | |
|
lr_decay | numeric | 0 | |
|
betas | untyped | c(0.9, 0.999) | - | |
amsgrad | logical | FALSE | TRUE, FALSE | - |
lambd | numeric | 1e-04 | |
|
alpha | numeric | 0.75 | |
|
t0 | numeric | 1e+06 | |
|
momentum | numeric | 0 | |
|
centered | logical | TRUE | TRUE, FALSE | - |
etas | untyped | c(0.5, 1.2) | - | |
step_sizes | untyped | c(1e-06, 50) | - | |
dampening | numeric | 0 | |
|
nesterov | logical | FALSE | TRUE, FALSE | - |
batch_size | integer | 256 | |
|
epochs | integer | 1 | |
|
verbose | logical | TRUE | TRUE, FALSE | - |
num_workers | integer | 0 | |
|
shuffle | logical | TRUE | TRUE, FALSE | - |
best_weights | logical | FALSE | TRUE, FALSE | - |
early_stopping | logical | FALSE | TRUE, FALSE | - |
min_delta | numeric | 0 | |
|
patience | integer | 10 | |
|
Package 'survivalmodels' is not on CRAN and has to be install from GitHub via
remotes::install_github("RaphaelS1/survivalmodels")
.
mlr3::Learner
-> mlr3proba::LearnerSurv
-> LearnerSurvDeepsurv
new()
Creates a new instance of this R6 class.
LearnerSurvDeepsurv$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvDeepsurv$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Katzman, L J, Shaham, Uri, Cloninger, Alexander, Bates, Jonathan, Jiang, Tingting, Kluger, Yuval (2018). “DeepSurv: personalized treatment recommender system using a Cox proportional hazards deep neural network.” BMC medical research methodology, 18(1), 1–12.
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/basics.html#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.deepsurv")
lrn("surv.deepsurv")
Fits a neural network based on pseudo-conditional survival probabilities.
Calls survivalmodels::dnnsurv()
from package 'survivalmodels'.
Custom nets can be used in this learner either using the
survivalmodels::build_keras_net utility function or using keras.
The number of output channels should be of length 1
and number of input channels is
the number of features plus number of cuts.
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 survivalmodels::predict.dnnsurv()
function.
crank
: the expected mortality using survivalmodels::surv_to_risk()
.
This Learner can be instantiated via lrn():
lrn("surv.dnnsurv")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, survivalmodels, keras, pseudo, tensorflow, distr6
Id | Type | Default | Levels | Range |
cuts | integer | 5 | |
|
cutpoints | untyped | - | - | |
custom_model | untyped | - | - | |
optimizer | character | adam | adadelta, adagrad, adamax, adam, nadam, rmsprop, sgd | - |
lr | numeric | 0.02 | |
|
beta_1 | numeric | 0.9 | |
|
beta_2 | numeric | 0.999 | |
|
epsilon | numeric | - | |
|
decay | numeric | 0 | |
|
clipnorm | numeric | - | |
|
clipvalue | numeric | - | |
|
momentum | numeric | 0 | |
|
nesterov | logical | FALSE | TRUE, FALSE | - |
loss_weights | untyped | - | - | |
weighted_metrics | untyped | - | - | |
early_stopping | logical | FALSE | TRUE, FALSE | - |
min_delta | numeric | 0 | |
|
patience | integer | 0 | |
|
verbose | integer | 0 | |
|
baseline | numeric | - | |
|
restore_best_weights | logical | FALSE | TRUE, FALSE | - |
batch_size | integer | 32 | |
|
epochs | integer | 10 | |
|
validation_split | numeric | 0 | |
|
shuffle | logical | TRUE | TRUE, FALSE | - |
sample_weight | untyped | - | - | |
initial_epoch | integer | 0 | |
|
steps_per_epoch | integer | - | |
|
validation_steps | integer | - | |
|
steps | integer | - | |
|
callbacks | untyped | - | - | |
rho | numeric | 0.95 | |
|
global_clipnorm | numeric | - | |
|
use_ema | logical | - | TRUE, FALSE | - |
ema_momentum | numeric | 0.99 | |
|
ema_overwrite_frequency | numeric | - | |
|
jit_compile | logical | TRUE | TRUE, FALSE | - |
initial_accumultator_value | numeric | 0.1 | |
|
amsgrad | logical | FALSE | TRUE, FALSE | - |
lr_power | numeric | -0.5 | |
|
l1_regularization_strength | numeric | 0 | |
|
l2_regularization_strength | numeric | 0 | |
|
l2_shrinkage_regularization_strength | numeric | 0 | |
|
beta | numeric | 0 | |
|
centered | logical | FALSE | TRUE, FALSE | - |
Package 'survivalmodels' is not on CRAN and has to be install from GitHub via
remotes::install_github("RaphaelS1/survivalmodels")
.
verbose
is initialized to 0.
mlr3::Learner
-> mlr3proba::LearnerSurv
-> LearnerSurvDNNSurv
new()
Creates a new instance of this R6 class.
LearnerSurvDNNSurv$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvDNNSurv$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Zhao, Lili, Feng, Dai (2019). “Dnnsurv: Deep neural networks for survival analysis using pseudo values.” arXiv preprint arXiv:1908.02337.
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/basics.html#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.dnnsurv")
lrn("surv.dnnsurv")
Flexible parametric spline learner.
Calls flexsurv::flexsurvspline()
from flexsurv.
This Learner can be instantiated via lrn():
lrn("surv.flexible")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, flexsurv, pracma
Id | Type | Default | Levels | Range |
bhazard | 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 | - | - | |
rtrunc | untyped | - | - | |
fixedpars | untyped | - | - | |
cl | numeric | 0.95 | |
|
maxiter | integer | 30 | |
|
rel.tolerance | numeric | 1e-09 | |
|
toler.chol | numeric | 1e-10 | |
|
debug | integer | 0 | |
|
outer.max | integer | 10 | |
|
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 flexsurv::flexsurvspline()
and the estimated coefficients.
For fitted coefficients, ,
and the test data covariates
, where
is a column of
s, the linear predictor vector is
.
distr
: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
Calculated using predict.flexsurvreg()
.
crank
: same as lp
.
k
:
Actual default: 0
Initial value: 1
Reason for change: The default value of 0
is equivalent to, and a much less efficient
implementation of, LearnerSurvParametric.
mlr3::Learner
-> mlr3proba::LearnerSurv
-> LearnerSurvFlexible
new()
Creates a new instance of this R6 class.
LearnerSurvFlexible$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvFlexible$clone(deep = FALSE)
deep
Whether 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/basics.html#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.flexible")
lrn("surv.flexible")
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, pracma
Id | Type | Default | Levels | Range |
family | character | coxph | coxph, weibull, loglog, lognormal, gehan, cindex, custom | - |
custom.family | untyped | - | - | |
nuirange | untyped | c(0, 100) | - | |
offset | numeric | - | |
|
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.
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)
deep
Whether 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/basics.html#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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.gbm") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.gbm") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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, pracma
Id | Type | Default | Levels | Range |
offset | numeric | - | |
|
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.
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.glmboost") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.glmboost") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 lambda
s 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).
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 | |
|
newoffset | untyped | - | - | |
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 | 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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.glmnet") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.glmnet") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 logistic hazard learner.
Calls survivalmodels::loghaz()
from package 'survivalmodels'.
Custom nets can be used in this learner either using the
survivalmodels::build_pytorch_net utility function or using torch
via reticulate.
The number of output channels depends on the number of discretised time-points, i.e.
the parameters cuts
or cutpoints
.
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 survivalmodels::predict.pycox()
function.
crank
: the expected mortality using survivalmodels::surv_to_risk()
.
This Learner can be instantiated via lrn():
lrn("surv.loghaz")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, survivalmodels, distr6, reticulate
Id | Type | Default | Levels | Range |
frac | numeric | 0 | |
|
cuts | integer | 10 | |
|
cutpoints | untyped | - | - | |
scheme | character | equidistant | equidistant, quantiles | - |
cut_min | numeric | 0 | |
|
num_nodes | untyped | c(32L, 32L) | - | |
batch_norm | logical | TRUE | TRUE, FALSE | - |
dropout | numeric | - | |
|
activation | character | relu | celu, elu, gelu, glu, hardshrink, hardsigmoid, hardswish, hardtanh, relu6, leakyrelu, ... | - |
custom_net | untyped | - | - | |
device | untyped | - | - | |
optimizer | character | adam | adadelta, adagrad, adam, adamax, adamw, asgd, rmsprop, rprop, sgd, sparse_adam | - |
rho | numeric | 0.9 | |
|
eps | numeric | 1e-08 | |
|
lr | numeric | 1 | |
|
weight_decay | numeric | 0 | |
|
learning_rate | numeric | 0.01 | |
|
lr_decay | numeric | 0 | |
|
betas | untyped | c(0.9, 0.999) | - | |
amsgrad | logical | FALSE | TRUE, FALSE | - |
lambd | numeric | 1e-04 | |
|
alpha | numeric | 0.75 | |
|
t0 | numeric | 1e+06 | |
|
momentum | numeric | 0 | |
|
centered | logical | TRUE | TRUE, FALSE | - |
etas | untyped | c(0.5, 1.2) | - | |
step_sizes | untyped | c(1e-06, 50) | - | |
dampening | numeric | 0 | |
|
nesterov | logical | FALSE | TRUE, FALSE | - |
batch_size | integer | 256 | |
|
epochs | integer | 1 | |
|
verbose | logical | TRUE | TRUE, FALSE | - |
num_workers | integer | 0 | |
|
shuffle | logical | TRUE | TRUE, FALSE | - |
best_weights | logical | FALSE | TRUE, FALSE | - |
early_stopping | logical | FALSE | TRUE, FALSE | - |
min_delta | numeric | 0 | |
|
patience | integer | 10 | |
|
interpolate | logical | FALSE | TRUE, FALSE | - |
inter_scheme | character | const_hazard | const_hazard, const_pdf | - |
sub | integer | 10 | |
|
Package 'survivalmodels' is not on CRAN and has to be install from GitHub via
remotes::install_github("RaphaelS1/survivalmodels")
.
mlr3::Learner
-> mlr3proba::LearnerSurv
-> LearnerSurvLogisticHazard
new()
Creates a new instance of this R6 class.
LearnerSurvLogisticHazard$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvLogisticHazard$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Gensheimer, F M, Narasimhan, BA (2018). “Simple discrete-time survival model for neural networks.” arXiv.
Kvamme, Håvard, Borgan Ø, Scheel I (2019). “Time-to-event prediction with neural networks and Cox regression.” arXiv preprint arXiv:1907.00825.
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/basics.html#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.loghaz")
lrn("surv.loghaz")
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) | - | |
offset | numeric | - | |
|
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 | - | |
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)
deep
Whether 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/basics.html#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, pracma
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.nelson") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.nelson") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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()
Parametric survival model.
Calls survivalmodels::parametric()
from package 'survivalmodels'.
This learner allows you to choose a distribution and a model form to compose
a predicted survival probability distribution .
The predict method is implemented in survivalmodels::predict.parametric()
.
Our implementation is more efficient for composition to distributions than
survival::predict.survreg()
.
The available model forms with their respective survival functions, are as follows:
Accelerated Failure Time (aft
)
Proportional Hazards (ph
)
Proportional Odds (po
)
Tobit (tobit
)
where is the estimated baseline survival distribution (in
this case with a given parametric form),
is the predicted linear
predictor,
is the cdf of a
distribution, and
is
the fitted scale parameter.
Whilst any combination of distribution and model form is possible, this does not mean it will necessarily create a sensible or interpretable prediction. The following combinations are 'sensible' (we note that ones mostly used in the literature):
dist = "gaussian"; form = "tobit";
dist = "weibull"; form = "ph"; (fairly used)
dist = "exponential"; form = "ph";
dist = "weibull"; form = "aft"; (fairly used, default option)
dist = "exponential"; form = "aft";
dist = "loglogistic"; form = "aft"; (fairly used)
dist = "lognormal"; form = "aft";
dist = "loglogistic"; form = "po";
This learner returns three prediction types:
lp
: a vector of linear predictors (relative risk scores), one per test
observation.
lp
is predicted using the formula where
are the
variables in the test data set and
are the fitted coefficients.
crank
: same as lp
.
distr
: a survival matrix in two dimensions, where observations are
represented in rows and time points in columns.
The distribution distr
is composed using the lp
predictions and specifying
a model form in the form
hyper-parameter, see Details.
The survival matrix uses the unique time points from the training set.
The parameter ntime
allows to adjust the granularity of these time points
to any number (e.g. 150
).
discrete
determines the class of the returned survival probability
distribution. If FALSE
, vectorized continuous probability distributions are
returned using distr6::VectorDistribution, otherwise a distr6::Matdist
object, which is faster for calculating survival measures that require a distr
prediction type. Default option is TRUE
.
This Learner can be instantiated via lrn():
lrn("surv.parametric")
Task type: “surv”
Predict Types: “crank”, “distr”, “lp”
Feature Types: “logical”, “integer”, “numeric”, “factor”
Required Packages: mlr3, mlr3proba, mlr3extralearners, survival, pracma
Id | Type | Default | Levels | Range |
form | character | aft | aft, ph, po, tobit | - |
na.action | untyped | - | - | |
dist | character | weibull | weibull, exponential, gaussian, lognormal, loglogistic | - |
parms | untyped | - | - | |
init | untyped | - | - | |
scale | numeric | 0 | |
|
maxiter | integer | 30 | |
|
rel.tolerance | numeric | 1e-09 | |
|
toler.chol | numeric | 1e-10 | |
|
debug | integer | 0 | |
|
outer.max | integer | 10 | |
|
robust | logical | FALSE | TRUE, FALSE | - |
score | logical | FALSE | TRUE, FALSE | - |
cluster | untyped | - | - | |
discrete | logical | - | TRUE, FALSE | - |
ntime | integer | NULL | |
|
round_time | integer | 2 | |
|
Package 'survivalmodels' is not on CRAN and has to be install from GitHub via
remotes::install_github("RaphaelS1/survivalmodels")
.
mlr3::Learner
-> mlr3proba::LearnerSurv
-> LearnerSurvParametric
new()
Creates a new instance of this R6 class.
returned risk
from survivalmodels is hp-style
ie higher value => higher risk
LearnerSurvParametric$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvParametric$clone(deep = FALSE)
deep
Whether to make a deep clone.
bblodfon
Kalbfleisch, D J, Prentice, L R (2011). The statistical analysis of failure time data. 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/basics.html#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 = mlr3::lrn("surv.parametric") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.parametric") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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-Hazard fits a discrete neural network based on a cross-entropy loss and
predictions of a discrete hazard function, also known as Nnet-Survival.
Calls survivalmodels::pchazard()
from package 'survivalmodels'.
Custom nets can be used in this learner either using the
survivalmodels::build_pytorch_net utility function or using torch
via reticulate.
The number of output channels depends on the number of discretised time-points, i.e.
the parameters cuts
or cutpoints
.
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 survivalmodels::predict.pycox()
function.
crank
: the expected mortality using survivalmodels::surv_to_risk()
.
This Learner can be instantiated via lrn():
lrn("surv.pchazard")
Task type: “surv”
Predict Types: “crank”, “distr”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3proba, mlr3extralearners, survivalmodels, distr6, reticulate
Id | Type | Default | Levels | Range |
frac | numeric | 0 | |
|
cuts | integer | 10 | |
|
cutpoints | untyped | - | - | |
scheme | character | equidistant | equidistant, quantiles | - |
cut_min | numeric | 0 | |
|
num_nodes | untyped | c(32L, 32L) | - | |
batch_norm | logical | TRUE | TRUE, FALSE | - |
reduction | character | mean | mean, none, sum | - |
dropout | numeric | - | |
|
activation | character | relu | celu, elu, gelu, glu, hardshrink, hardsigmoid, hardswish, hardtanh, relu6, leakyrelu, ... | - |
custom_net | untyped | - | - | |
device | untyped | - | - | |
optimizer | character | adam | adadelta, adagrad, adam, adamax, adamw, asgd, rmsprop, rprop, sgd, sparse_adam | - |
rho | numeric | 0.9 | |
|
eps | numeric | 1e-08 | |
|
lr | numeric | 1 | |
|
weight_decay | numeric | 0 | |
|
learning_rate | numeric | 0.01 | |
|
lr_decay | numeric | 0 | |
|
betas | untyped | c(0.9, 0.999) | - | |
amsgrad | logical | FALSE | TRUE, FALSE | - |
lambd | numeric | 1e-04 | |
|
alpha | numeric | 0.75 | |
|
t0 | numeric | 1e+06 | |
|
momentum | numeric | 0 | |
|
centered | logical | TRUE | TRUE, FALSE | - |
etas | untyped | c(0.5, 1.2) | - | |
step_sizes | untyped | c(1e-06, 50) | - | |
dampening | numeric | 0 | |
|
nesterov | logical | FALSE | TRUE, FALSE | - |
batch_size | integer | 256 | |
|
epochs | integer | 1 | |
|
verbose | logical | TRUE | TRUE, FALSE | - |
num_workers | integer | 0 | |
|
shuffle | logical | TRUE | TRUE, FALSE | - |
best_weights | logical | FALSE | TRUE, FALSE | - |
early_stopping | logical | FALSE | TRUE, FALSE | - |
min_delta | numeric | 0 | |
|
patience | integer | 10 | |
|
interpolate | logical | FALSE | TRUE, FALSE | - |
sub | integer | 10 | |
|
Package 'survivalmodels' is not on CRAN and has to be install from GitHub via
remotes::install_github("RaphaelS1/survivalmodels")
.
mlr3::Learner
-> mlr3proba::LearnerSurv
-> LearnerSurvPCHazard
new()
Creates a new instance of this R6 class.
LearnerSurvPCHazard$new()
clone()
The objects of this class are cloneable with this method.
LearnerSurvPCHazard$clone(deep = FALSE)
deep
Whether to make a deep clone.
RaphaelS1
Kvamme, Håvard, Borgan Ø (2019). “Continuous and discrete-time survival prediction with neural networks.” arXiv preprint arXiv:1910.06724.
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/basics.html#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.pchazard")
lrn("surv.pchazard")
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, pracma
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.penalized") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.penalized") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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)
deep
Whether 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/basics.html#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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.ranger", importance = "permutation") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.ranger", importance = "permutation") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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, pracma
Id | Type | Default | Levels | Range |
ntree | integer | 500 | |
|
mtry | integer | - | |
|
mtry.ratio | numeric | - | |
|
nodesize | integer | 15 | |
|
nodedepth | integer | - | |
|
splitrule | character | logrank | logrank, bs.gradient, logrankscore | - |
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 | |
|
ntime | integer | 150 | |
|
cause | 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, by.tree | - |
split.depth | character | FALSE | FALSE, all.trees, by.tree | - |
seed | integer | - | |
|
do.trace | logical | FALSE | TRUE, FALSE | - |
statistics | logical | FALSE | TRUE, FALSE | - |
get.tree | untyped | - | - | |
outcome | character | train | train, test | - |
ptn.count | integer | 0 | |
|
estimator | character | nelson | nelson, kaplan | - |
cores | integer | 1 | |
|
save.memory | logical | FALSE | TRUE, FALSE | - |
perf.type | character | - | none | - |
case.depth | logical | FALSE | TRUE, FALSE | - |
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
.
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.rfsrc", importance = "TRUE") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.rfsrc", importance = "TRUE") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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()
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)
deep
Whether 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/basics.html#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 = mlr3::tsk("rats") # Create train and test set ids = mlr3::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 = mlr3::tsk("rats") # Create train and test set ids = mlr3::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
.
nrounds
is initialized to 1000.
nthread
is initialized to 1 to avoid conflicts with parallelization via future.
verbose
is initialized to 0.
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 | list() | - | |
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 | |
|
eta | numeric | 0.3 | |
|
feature_selector | character | cyclic | cyclic, shuffle, random, greedy, thrifty | - |
feval | untyped | NULL | - | |
gamma | numeric | 0 | |
|
grow_policy | character | depthwise | depthwise, lossguide | - |
interaction_constraints | untyped | - | - | |
iterationrange | untyped | - | - | |
lambda | numeric | 1 | |
|
lambda_bias | numeric | 0 | |
|
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 | |
|
missing | numeric | NA | |
|
monotone_constraints | integer | 0 | |
|
normalize_type | character | tree | tree, forest | - |
nrounds | integer | - | |
|
nthread | integer | 1 | |
|
ntreelimit | integer | - | |
|
num_parallel_tree | integer | 1 | |
|
one_drop | logical | FALSE | TRUE, FALSE | - |
print_every_n | integer | 1 | |
|
process_type | character | default | default, update | - |
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 | |
|
strict_shape | logical | FALSE | TRUE, FALSE | - |
subsample | numeric | 1 | |
|
top_k | integer | 0 | |
|
tree_method | character | auto | auto, exact, approx, hist, gpu_hist | - |
tweedie_variance_power | numeric | 1.5 | |
|
updater | untyped | - | - | |
verbose | integer | 1 | |
|
watchlist | untyped | NULL | - | |
xgb_model | untyped | - | - | |
device | untyped | - | - | |
mlr3::Learner
-> mlr3proba::LearnerSurv
-> LearnerSurvXgboostAFT
internal_valid_scores
The last observation of the validation scores for all metrics.
Extracted from model$evaluation_log
internal_tuned_values
Returns the early stopped iterations if early_stopping_rounds
was set during training.
validate
How to construct the internal validation data. This parameter can be either NULL
,
a ratio, "test"
, or "predefined"
.
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.xgboost.aft") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.xgboost.aft") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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
is 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() | - | |
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 | |
|
eta | numeric | 0.3 | |
|
feature_selector | character | cyclic | cyclic, shuffle, random, greedy, thrifty | - |
feval | untyped | NULL | - | |
gamma | numeric | 0 | |
|
grow_policy | character | depthwise | depthwise, lossguide | - |
interaction_constraints | untyped | - | - | |
iterationrange | untyped | - | - | |
lambda | numeric | 1 | |
|
lambda_bias | numeric | 0 | |
|
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 | |
|
missing | numeric | NA | |
|
monotone_constraints | integer | 0 | |
|
normalize_type | character | tree | tree, forest | - |
nrounds | integer | - | |
|
nthread | integer | 1 | |
|
num_parallel_tree | integer | 1 | |
|
one_drop | logical | FALSE | TRUE, FALSE | - |
print_every_n | integer | 1 | |
|
process_type | character | default | default, update | - |
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 | |
|
strict_shape | logical | FALSE | TRUE, FALSE | - |
subsample | numeric | 1 | |
|
top_k | integer | 0 | |
|
tree_method | character | auto | auto, exact, approx, hist, gpu_hist | - |
tweedie_variance_power | numeric | 1.5 | |
|
updater | untyped | - | - | |
verbose | integer | 1 | |
|
watchlist | untyped | NULL | - | |
xgb_model | untyped | - | - | |
device | untyped | - | - | |
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
The last observation of the validation scores for all metrics.
Extracted from model$evaluation_log
internal_tuned_values
Returns the early stopped iterations if early_stopping_rounds
was set during training.
validate
How to construct the internal validation data. This parameter can be either NULL
,
a ratio, "test"
, or "predefined"
.
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)
deep
Whether 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/basics.html#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 = mlr3::lrn("surv.xgboost.cox") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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 = mlr3::lrn("surv.xgboost.cox") print(learner) # Define a Task task = mlr3::tsk("grace") # Create train and test set ids = mlr3::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()