Skip to contents

Random survival forest. Calls ranger::ranger() from package ranger.

Custom mlr3 parameters

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

Initial parameter values

  • num.threads is initialized to 1 to avoid conflicts with parallelization via future.

Dictionary

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

mlr_learners$get("surv.ranger")
lrn("surv.ranger")

Meta Information

  • Task type: “surv”

  • Predict Types: “crank”, “distr”

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

  • Required Packages: mlr3, mlr3proba, mlr3extralearners, ranger

Parameters

IdTypeDefaultLevelsRange
alphanumeric0.5\((-\infty, \infty)\)
always.split.variablesuntyped--
holdoutlogicalFALSETRUE, FALSE-
importancecharacter-none, impurity, impurity_corrected, permutation-
keep.inbaglogicalFALSETRUE, FALSE-
max.depthintegerNULL\([0, \infty)\)
min.node.sizeinteger5\([1, \infty)\)
minpropnumeric0.1\((-\infty, \infty)\)
mtryinteger-\([1, \infty)\)
mtry.rationumeric-\([0, 1]\)
num.random.splitsinteger1\([1, \infty)\)
num.threadsinteger1\([1, \infty)\)
num.treesinteger500\([1, \infty)\)
oob.errorlogicalTRUETRUE, FALSE-
regularization.factoruntyped1-
regularization.usedepthlogicalFALSETRUE, FALSE-
replacelogicalTRUETRUE, FALSE-
respect.unordered.factorscharacterignoreignore, order, partition-
sample.fractionnumeric-\([0, 1]\)
save.memorylogicalFALSETRUE, FALSE-
scale.permutation.importancelogicalFALSETRUE, FALSE-
seedintegerNULL\((-\infty, \infty)\)
split.select.weightsnumeric-\([0, 1]\)
splitrulecharacterlogranklogrank, extratrees, C, maxstat-
verboselogicalTRUETRUE, FALSE-
write.forestlogicalTRUETRUE, FALSE-
min.bucketinteger3\((-\infty, \infty)\)
time.interestintegerNULL\([1, \infty)\)
node.statslogicalFALSETRUE, FALSE-

References

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 .

See also

Author

be-marc

Super classes

mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvRanger

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method importance()

The importance scores are extracted from the model slot variable.importance.

Usage

LearnerSurvRanger$importance()

Returns

Named numeric().


Method oob_error()

The out-of-bag error is extracted from the model slot prediction.error.

Usage

LearnerSurvRanger$oob_error()

Returns

numeric(1).


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerSurvRanger$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

learner = mlr3::lrn("surv.ranger")
print(learner)
#> <LearnerSurvRanger:surv.ranger>: Random Forest
#> * Model: -
#> * Parameters: num.threads=1
#> * Packages: mlr3, mlr3proba, mlr3extralearners, ranger
#> * Predict Types:  crank, [distr]
#> * Feature Types: logical, integer, numeric, character, factor, ordered
#> * Properties: importance, oob_error, weights

# available parameters:
learner$param_set$ids()
#>  [1] "alpha"                        "always.split.variables"      
#>  [3] "holdout"                      "importance"                  
#>  [5] "keep.inbag"                   "max.depth"                   
#>  [7] "min.node.size"                "minprop"                     
#>  [9] "mtry"                         "mtry.ratio"                  
#> [11] "num.random.splits"            "num.threads"                 
#> [13] "num.trees"                    "oob.error"                   
#> [15] "regularization.factor"        "regularization.usedepth"     
#> [17] "replace"                      "respect.unordered.factors"   
#> [19] "sample.fraction"              "save.memory"                 
#> [21] "scale.permutation.importance" "seed"                        
#> [23] "split.select.weights"         "splitrule"                   
#> [25] "verbose"                      "write.forest"                
#> [27] "min.bucket"                   "time.interest"               
#> [29] "node.stats"