Skip to contents

Dictionary

This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():

mlr_learners$get("regr.rfsrc")
lrn("regr.rfsrc")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”

  • Feature Types: “logical”, “integer”, “numeric”, “factor”

  • Required Packages: mlr3extralearners, randomForestSRC

Parameters

IdTypeDefaultLevelsRange
ntreeinteger1000\([1, \infty)\)
mtryinteger-\([1, \infty)\)
mtry.rationumeric-\([0, 1]\)
nodesizeinteger15\([1, \infty)\)
nodedepthinteger-\([1, \infty)\)
splitrulecharactermsemse, quantile.regr, la.quantile.regr\((-\infty, \infty)\)
nsplitinteger10\([0, \infty)\)
importancecharacterFALSEFALSE, TRUE, none, permute, random, anti\((-\infty, \infty)\)
block.sizeinteger10\([1, \infty)\)
ensemblecharacterallall, oob, inbag\((-\infty, \infty)\)
bootstrapcharacterby.rootby.root, by.node, none, by.user\((-\infty, \infty)\)
samptypecharactersworswor, swr\((-\infty, \infty)\)
samplist-\((-\infty, \infty)\)
membershiplogicalFALSETRUE, FALSE\((-\infty, \infty)\)
sampsizelist-\((-\infty, \infty)\)
sampsize.rationumeric-\([0, 1]\)
na.actioncharacterna.omitna.omit, na.impute\((-\infty, \infty)\)
nimputeinteger1\([1, \infty)\)
ntimeinteger-\([1, \infty)\)
causeinteger-\([1, \infty)\)
proximitycharacterFALSEFALSE, TRUE, inbag, oob, all\((-\infty, \infty)\)
distancecharacterFALSEFALSE, TRUE, inbag, oob, all\((-\infty, \infty)\)
forest.wtcharacterFALSEFALSE, TRUE, inbag, oob, all\((-\infty, \infty)\)
xvar.wtlist-\((-\infty, \infty)\)
split.wtlist-\((-\infty, \infty)\)
forestlogicalTRUETRUE, FALSE\((-\infty, \infty)\)
var.usedcharacterFALSEFALSE, all.trees, by.tree\((-\infty, \infty)\)
split.depthcharacterFALSEFALSE, all.trees, by.tree\((-\infty, \infty)\)
seedinteger-\((-\infty, -1]\)
do.tracelogicalFALSETRUE, FALSE\((-\infty, \infty)\)
statisticslogicalFALSETRUE, FALSE\((-\infty, \infty)\)
get.treelist-\((-\infty, \infty)\)
outcomecharactertraintrain, test\((-\infty, \infty)\)
ptn.countinteger0\([0, \infty)\)
coresinteger1\([1, \infty)\)

Custom mlr3 defaults

  • cores:

    • Actual default: Auto-detecting the number of cores

    • Adjusted default: 1

    • Reason for change: Threading conflicts with explicit parallelization via future.

  • 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.

References

Breiman, Leo (2001). “Random Forests.” Machine Learning, 45(1), 5--32. ISSN 1573-0565, doi: 10.1023/A:1010933404324 .

See also

Author

RaphaelS1

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrRandomForestSRC

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.


Method importance()

The importance scores are extracted from the model slot importance.

Usage

LearnerRegrRandomForestSRC$importance()

Returns

Named numeric().


Method selected_features()

Selected features are extracted from the model slot var.used.

Usage

LearnerRegrRandomForestSRC$selected_features()

Returns

character().


Method oob_error()

OOB error extracted from the model slot err.rate.

Usage

LearnerRegrRandomForestSRC$oob_error()

Returns

numeric().


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerRegrRandomForestSRC$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (requireNamespace("randomForestSRC", quietly = TRUE)) {
  learner = mlr3::lrn("regr.rfsrc")
  print(learner)

  # available parameters:
  learner$param_set$ids()
}
#> <LearnerRegrRandomForestSRC:regr.rfsrc>
#> * Model: -
#> * Parameters: list()
#> * Packages: mlr3, mlr3extralearners, randomForestSRC
#> * Predict Type: response
#> * Feature types: logical, integer, numeric, factor
#> * Properties: importance, missings, oob_error, weights
#>  [1] "ntree"          "mtry"           "mtry.ratio"     "nodesize"      
#>  [5] "nodedepth"      "splitrule"      "nsplit"         "importance"    
#>  [9] "block.size"     "ensemble"       "bootstrap"      "samptype"      
#> [13] "samp"           "membership"     "sampsize"       "sampsize.ratio"
#> [17] "na.action"      "nimpute"        "ntime"          "cause"         
#> [21] "proximity"      "distance"       "forest.wt"      "xvar.wt"       
#> [25] "split.wt"       "forest"         "var.used"       "split.depth"   
#> [29] "seed"           "do.trace"       "statistics"     "get.tree"      
#> [33] "outcome"        "ptn.count"      "cores"