tuneICRF {ICcforest} | R Documentation |
Tune mtry to the optimal value with respect to out-of-bag error for an ICcforest 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 ICcforest.
Usage
tuneICRF(
formula,
data,
mtryStart = NULL,
stepFactor = 1.5,
ntreeTry = 100L,
control = partykit::ctree_control(teststat = "quad", testtype = "Univ", mincriterion =
0, saveinfo = FALSE, minsplit = nrow(data) * 0.15, minbucket = nrow(data) * 0.06),
suppress = TRUE,
trace = TRUE,
plot = FALSE,
doBest = FALSE
)
Arguments
formula |
a formula object, with the response being a
|
data |
a data frame containing the variables named in |
mtryStart |
starting value of |
stepFactor |
at each iteration, |
ntreeTry |
number of trees used at the tuning step. |
control |
a list with control parameters, see |
suppress |
a logical specifying whether the messages from |
trace |
whether to print the progress of the search. |
plot |
whether to plot the out-of-bag error as a function of |
doBest |
whether to run an ICcforest using the optimal mtry found. |
Value
If doBest=FALSE
(default), this returns the optimal mtry value of those searched.
If doBest=TRUE
, this returns the ICcforest object produced with the optimal mtry.
See Also
sbrier_IC
for evaluation of model fit for interval-censored data
when searching for the optimal value of mtry
.
Examples
### Example with dataset tandmob2
library(icenReg)
data(miceData)
## For ICcforest to run, Inf should be set to be a large number, for example, 9999999.
miceData$u[miceData$u == Inf] <- 9999999.
## Create a new variable to be selected from
miceData$new = rep(1:4)
## Tune mtry
mtryTune <- tuneICRF(Surv(l, u, type = "interval2") ~ grp + new, data = miceData)