Survival Conditional Inference Tree Learner
mlr_learners_surv.ctree.Rd
Survival Partition Tree where a significance test is used to determine the univariate splits.
Calls partykit::ctree()
from partykit.
Prediction types
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 internalpartykit::predict.party()
function.crank
: the expected mortality usingmlr3proba::.surv_return()
.
Parameters
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 | \([0, 1]\) | |
mincriterion | numeric | 0.95 | \([0, 1]\) | |
logmincriterion | numeric | - | \((-\infty, \infty)\) | |
minsplit | integer | 20 | \([1, \infty)\) | |
minbucket | integer | 7 | \([1, \infty)\) | |
minprob | numeric | 0.01 | \([0, \infty)\) | |
stump | logical | FALSE | TRUE, FALSE | - |
lookahead | logical | FALSE | TRUE, FALSE | - |
MIA | logical | FALSE | TRUE, FALSE | - |
nresample | integer | 9999 | \([1, \infty)\) | |
tol | numeric | - | \([0, \infty)\) | |
maxsurrogate | integer | 0 | \([0, \infty)\) | |
numsurrogate | logical | FALSE | TRUE, FALSE | - |
mtry | integer | Inf | \([0, \infty)\) | |
maxdepth | integer | Inf | \([0, \infty)\) | |
maxvar | integer | - | \([1, \infty)\) | |
multiway | logical | FALSE | TRUE, FALSE | - |
splittry | integer | 2 | \([0, \infty)\) | |
intersplit | logical | FALSE | TRUE, FALSE | - |
majority | logical | FALSE | TRUE, FALSE | - |
caseweights | logical | FALSE | TRUE, FALSE | - |
applyfun | untyped | - | - | |
cores | integer | NULL | \((-\infty, \infty)\) | |
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 | \((-\infty, \infty)\) | |
abseps | numeric | 0.001 | \([0, \infty)\) | |
releps | numeric | 0 | \([0, \infty)\) |
References
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.
See also
as.data.table(mlr_learners)
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.
Super classes
mlr3::Learner
-> mlr3proba::LearnerSurv
-> LearnerSurvCTree
Examples
# Define the Learner
learner = mlr3::lrn("surv.ctree")
print(learner)
#> <LearnerSurvCTree:surv.ctree>: Conditional Inference Tree
#> * Model: -
#> * Parameters: list()
#> * Packages: mlr3, mlr3proba, mlr3extralearners, partykit, coin,
#> sandwich
#> * Predict Types: [crank], distr
#> * Feature Types: integer, numeric, factor, ordered
#> * Properties: weights
# 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)
#>
#> Model formula:
#> Surv(time, status, type = "right") ~ age + los + revasc + revascdays +
#> stchange + sysbp
#>
#> Fitted party:
#> [1] root
#> | [2] age <= 72
#> | | [3] revascdays <= 171
#> | | | [4] revasc <= 0
#> | | | | [5] los <= 2: 2.000 (n = 24)
#> | | | | [6] los > 2
#> | | | | | [7] age <= 62: 99.000 (n = 29)
#> | | | | | [8] age > 62: 28.000 (n = 36)
#> | | | [9] revasc > 0: Inf (n = 248)
#> | | [10] revascdays > 171: Inf (n = 92)
#> | [11] age > 72
#> | | [12] revascdays <= 173
#> | | | [13] revasc <= 0
#> | | | | [14] stchange <= 0: 67.000 (n = 32)
#> | | | | [15] stchange > 0: 20.000 (n = 64)
#> | | | [16] revasc > 0: Inf (n = 104)
#> | | [17] revascdays > 173: Inf (n = 41)
#>
#> Number of inner nodes: 8
#> Number of terminal nodes: 9
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
#> surv.cindex
#> 0.8121094