predict.ICcforest {ICcforest} | R Documentation |
Predict from an ICcforest model
Description
Compute predictions from ICcforest objects.
Usage
## S3 method for class 'ICcforest'
predict(
object,
newdata = NULL,
OOB = FALSE,
suppress = TRUE,
type = c("response", "prob", "weights", "node"),
FUN = NULL,
simplify = TRUE,
scale = TRUE,
...
)
Arguments
object |
an object as returned by |
newdata |
an optional data frame containing test data. |
OOB |
a logical specifying whether out-of-bag predictions are desired (only if |
suppress |
a logical specifying whether the messages from |
type |
a character string denoting the type of predicted value returned. For |
FUN |
a function to compute summary statistics. Predictions for each node must be
computed based on arguments |
simplify |
a logical indicating whether the resulting list of predictions should be
converted to a suitable vector or matrix (if possible), see |
scale |
a logical indicating scaling of the nearest neighbor weights by the sum of weights
in the corresponding terminal node of each tree, see |
... |
additional arguments. |
Value
An object of class ICcforest
, as a subclass of cforest
.
See Also
sbrier_IC
for evaluation of model fit for interval-censored data
Examples
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.
## First, fit an iterval-censored conditional inference forest
Cforest <- ICcforest(formula = Surv(l,u,type="interval2")~grp, data = miceData)
## Predict the survival function constructed using the non-parametric maximum likelihood estimator
Pred <- predict(Cforest, type = "prob")
## Out-of-bag prediction of the median survival time
PredOOB <- predict(Cforest, type = "response", OOB = TRUE)