tune.ltrccif {LTRCforests} | R Documentation |
Tune mtry
to the optimal value with respect to out-of-bag error for a LTRCCIF model
Description
Starting with the default value of mtry
, search for the optimal value
(with respect to out-of-bag error estimate) of mtry
for ltrccif
.
Usage
tune.ltrccif(
formula,
data,
id,
mtryStart = NULL,
stepFactor = 2,
time.eval = NULL,
time.tau = NULL,
ntreeTry = 100L,
bootstrap = c("by.sub", "by.root", "none", "by.user"),
samptype = c("swor", "swr"),
sampfrac = 0.632,
samp = NULL,
na.action = "na.omit",
trace = TRUE,
doBest = FALSE,
plot = FALSE,
applyfun = NULL,
cores = NULL,
control = partykit::ctree_control(teststat = "quad", testtype = "Univ", mincriterion =
0, saveinfo = FALSE, minsplit = max(ceiling(sqrt(nrow(data))), 20), minbucket =
max(ceiling(sqrt(nrow(data))), 7), minprob = 0.01)
)
Arguments
formula |
a formula object, with the response being a
|
data |
a data frame containing |
id |
variable name of subject identifiers. If this is present, it will be
searched for in the |
mtryStart |
starting value of |
stepFactor |
at each iteration, |
time.eval |
a vector of time points, at which the estimated survival probabilities are evaluated. |
time.tau |
an optional vector, with the i-th entry giving the upper time limit for the
computed survival probabilities for the i-th data (i.e., only computes
survival probabilies at |
ntreeTry |
number of trees used at the tuning step. |
bootstrap |
bootstrap protocol.
(1) If |
samptype |
choices are |
sampfrac |
a fraction, determining the proportion of subjects to draw
without replacement when |
samp |
Bootstrap specification when |
na.action |
action taken if the data contains |
trace |
whether to print the progress of the search. |
doBest |
whether to run a |
plot |
whether to plot the out-of-bag error as a function of |
applyfun |
an optional |
cores |
numeric. See |
control |
a list with control parameters, see |
Value
If doBest = FALSE
(default), this returns the optimal mtry value of those searched.
If doBest = TRUE
, this returns the ltrccif
object produced with the optimal mtry
.
See Also
sbrier_ltrc
for evaluation of model fit when searching
for the optimal value of mtry
.
Examples
### Example with data pbcsample
library(survival)
Formula = Surv(Start, Stop, Event) ~ age + alk.phos + ast + chol + edema
## mtry tuned by the OOB procedure with stepFactor 3, number of trees built 10.
mtryT = tune.ltrccif(formula = Formula, data = pbcsample, id = ID, stepFactor = 3,
ntreeTry = 10L)