tuneICRF: Tune mtry to the optimal value with respect to out-of-bag...

Description Usage Arguments Value See Also Examples

View source: R/tuneICRF.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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 Surv object, with form

Surv(time1, time2, type="interval2").

data

a data frame containing the variables named in Formula.

mtryStart

starting value of mtry; default is sqrt(nvar).

stepFactor

at each iteration, mtry is inflated (or deflated) by this value.

ntreeTry

number of trees used at the tuning step.

control

a list with control parameters, see cforest. The default values correspond to those of the default values used by ICcforest.

suppress

a logical specifying whether the messages from getFitEsts are suppressed. If FALSE, the messages are printed. suppress = TRUE is set by default.

trace

whether to print the progress of the search. trace = TRUE is set by default.

plot

whether to plot the out-of-bag error as a function of mtry.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
### 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)

ICcforest documentation built on Feb. 17, 2020, 9:07 a.m.