Skip to contents

Random survival forests for blocks of clinical and omics covariate data. Calls blockForest::blockfor() from package blockForest.

In this learner, only the trained forest object ($forest) is retained. The optimized block-specific tuning parameters (paramvalues) and the biased OOB error estimate (biased_oob_error_donotuse) are discarded, as they are either not needed for downstream use or not reliable for performance estimation.

Prediction types

This learner returns two prediction types:

  1. distr: a survival matrix in two dimensions, where observations are represented in rows and (unique event) time points in columns. Calculated using the internal blockForest:::predict.blockForest() function.

  2. crank: the expected mortality using mlr3proba::surv_return().

Initial parameter values

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

Dictionary

This Learner can be instantiated via lrn():

lrn("surv.blockforest")

Meta Information

  • Task type: “surv”

  • Predict Types: “crank”, “distr”

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

  • Required Packages: mlr3, mlr3proba, mlr3extralearners, blockForest

Parameters

IdTypeDefaultLevelsRange
blocksuntyped--
block.methodcharacterBlockForestBlockForest, RandomBlock, BlockVarSel, VarProb, SplitWeights-
num.treesinteger2000\([1, \infty)\)
mtryuntypedNULL-
nsetsinteger300\([1, \infty)\)
num.trees.preinteger1500\([1, \infty)\)
splitrulecharacterextratreeslogrank, extratrees, C, maxstat-
always.select.blockinteger0\([0, 1]\)
importancecharacter-none, impurity, impurity_corrected, permutation-
num.threadsinteger-\([1, \infty)\)
seedintegerNULL\((-\infty, \infty)\)
verboselogicalTRUETRUE, FALSE-

References

Hornung, R., Wright, N. M (2019). “Block Forests: Random forests for blocks of clinical and omics covariate data.” BMC Bioinformatics, 20(1), 1–17. doi:10.1186/s12859-019-2942-y , https://doi.org/10.1186/s12859-019-2942-y.

See also

Author

bblodfon

Super classes

mlr3::Learner -> mlr3proba::LearnerSurv -> LearnerSurvBlockForest

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.


Method importance()

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

Usage

LearnerSurvBlockForest$importance()

Returns

Named numeric().


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerSurvBlockForest$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define a Task
task = tsk("grace")
# Create train and test set
ids = partition(task)
# check task's features
task$feature_names
#> [1] "age"        "los"        "revasc"     "revascdays" "stchange"  
#> [6] "sysbp"     
# partition features to 2 blocks
blocks = list(bl1 = 1:3, bl2 = 4:6)
# define learner
learner = lrn("surv.blockforest", blocks = blocks,
              importance = "permutation", nsets = 10,
              num.trees = 50, num.trees.pre = 10, splitrule = "logrank")
# Train the learner on the training ids
learner$train(task, row_ids = ids$train)
# feature importance
learner$importance()
#>  revascdays      revasc         age         los       sysbp    stchange 
#> 0.150832886 0.073598048 0.031141673 0.014960892 0.012258867 0.004614054 
# Make predictions for the test observations
pred = learner$predict(task, row_ids = ids$test)
pred
#> 
#> ── <PredictionSurv> for 330 observations: ──────────────────────────────────────
#>  row_ids  time status     crank     distr
#>       10 180.0  FALSE  17.32047 <list[1]>
#>       12 180.0  FALSE  11.14081 <list[1]>
#>       15   5.0  FALSE  17.75060 <list[1]>
#>      ---   ---    ---       ---       ---
#>      993  53.0   TRUE 101.10399 <list[1]>
#>      995   0.5   TRUE  84.59135 <list[1]>
#>      998 180.0  FALSE  23.29207 <list[1]>
# Score the predictions
pred$score()
#> surv.cindex 
#>   0.8359786