The function predict.nft2()/predict.nft()
is the main function for drawing posterior predictive realizations at new inputs using a fitted model stored in a nft2/nft
object returned from nft2()/nft()
.
# S3 method for nft2
predict(
## data
object,
xftest=object$xftrain,
xstest=object$xstrain,
## multi-threading
tc=getOption("mc.cores", 1), ##OpenMP thread count
## current process fit vs. previous process fit
XPtr=TRUE,
## predictions
K=0,
events=object$events,
FPD=FALSE,
probs=c(0.025, 0.975),
take.logs=TRUE,
na.rm=FALSE,
RMST.max=NULL,
## default settings for NFT:BART/HBART/DPM
fmu=object$NFT$fmu,
soffset=object$soffset,
drawDPM=object$drawDPM,
## etc.
...)# S3 method for nft
predict(
## data
object,
x.test=object$x.train,
## multi-threading
tc=getOption("mc.cores", 1), ##OpenMP thread count
## current process fit vs. previous process fit
XPtr=TRUE,
## predictions
K=0,
events=object$events,
FPD=FALSE,
probs=c(0.025, 0.975),
take.logs=TRUE,
na.rm=FALSE,
RMST.max=NULL,
## default settings for NFT:BART/HBART/DPM
fmu=object$NFT$fmu,
soffset=object$soffset,
drawDPM=object$drawDPM,
## etc.
...)
Posterior realizations of the mean function stored in a matrix. Omitted if partial dependence functions are performed since these will typically be large.
Posterior realizations of the SD function stored in a matrix. Omitted if partial dependence functions are performed since these will typically be large.
Posterior predictive mean of mean function.
Posterior predictive lower quantile of mean function.
Posterior predictive upper quantile of mean function.
Posterior predictive mean of SD function.
Posterior predictive lower quantile of SD function.
Posterior predictive upper quantile of SD function.
Survival function posterior draws on a grid of time-points by the partial dependence function when requested.
Survival function estimates on a grid of time-points by the partial dependence function when requested.
Survival function lower quantiles on a grid of time-points by the partial dependence function when requested.
Survival function upper quantiles on a grid of time-points by the partial dependence function when requested.
Object of type nft2/nft
from a previous call to
nft2()/nft()
.
New input settings in the form of a matrix at which to construct predictions. Defaults to the training inputs.
Number of OpenMP threads to use for parallel computing.
If object
was created during the currently running
R process, then (via an Rcpp XPtr
) the BART/HBART tree
ensemble objects can be accessed in RAM; otherwise, those objects
will need to be loaded from their string encodings.
The length of the grid of time-points to be used for survival predictions. Set to zero to avoid these calculations which can be time-consuming for large data sets.
You can specify the grid of time-points; otherwise, they are derived from quantiles of the augmented event times.
Whether to yield the usual predictions or marginal predictions calculated by the partial dependence function.
A vector of length two containing the lower and upper quantiles to be calculated for the predictions.
Whether or not to take logarithms.
Whether NA
values should be removed from the
summaries.
To calculate Restricted Mean Survival Time (RMST), we need to set a reasonable time maxima. Typically, a clinically important time that a majority (or a large plurality) of censored subjects have been followed through that point or beyond.
BART centering parameter for the test data. Defaults to
the value used by nft2()/nft()
when training the model.
HBART centering parameter for the test data. Defaults to the value used by nft2()/nft()
when training the model.
Whether NFT BART was fit with, or without, DPM.
The et cetera objects passed to the predict
method.
Currently, it has no functionality.
Rodney Sparapani: rsparapa@mcw.edu
predict.nft2()/predict.nft()
is the main function for
calculating posterior predictions and uncertainties once a model has
been fit by nft2()/nft()
.
Returns a list with the following entries.
nft2
, nft