XGpred_predict {csmpv} | R Documentation |
Predicting Risk Group Classification for a New Data Set
Description
The XGpred_predict function is designed to predict risk group classifications for a new data set. This prediction is based on the assumption that an XGpred object is available from a training data set and that the new data set is comparable to the training data set.
In scenarios where the new and training data sets are not directly comparable, a calibration cohort is required to ensure accurate risk group predictions.
Usage
XGpred_predict(newdat = NULL, XGpredObj = NULL, scoreShift = 0)
Arguments
newdat |
A data matrix or a data frame where samples are in rows and features/traits are in columns. It should include all variables needed for the prediction model. |
XGpredObj |
An XGpred object returned by the XGpred function. Although not all items are needed for prediction purposes, using the XGpred object as input is convenient. |
scoreShift |
A calibration value to subtract from the current model score if needed. |
Value
A data frame containing XGpred_score, XGpred_prob, and XGpred_prob_class
Author(s)
Aixiang Jiang
References
Aoki T, Jiang A, Xu A et al.,(2023) Spatially Resolved Tumor Microenvironment Predicts Treatment Outcomes in Relapsed/Refractory Hodgkin Lymphoma. J Clin Oncol. 2023 Dec 19:JCO2301115. doi: 10.1200/JCO.23.01115. Epub ahead of print. PMID: 38113419.
Examples
# Load in data sets:
data("datlist", package = "csmpv")
tdat = datlist$training
vdat = datlist$validation
# The function saves files locally. You can define your own temporary directory.
# If not, tempdir() can be used to get the system's temporary directory.
temp_dir = tempdir()
# As an example, let's define Xvars, which will be used later:
Xvars = c("highIPI", "B.Symptoms", "MYC.IHC", "BCL2.IHC", "CD10.IHC", "BCL6.IHC")
# For given time-to-event outcome and Xvars, we can build up a binary risk classification:
xgobj = XGpred(data = tdat, varsIn = Xvars,
time = "FFP..Years.",
event = "Code.FFP", outfile = paste0(temp_dir, "/XGpred"))
tdat$XGpred_class = xgobj$XGpred_prob_class
# You might save the files to the directory you want.
# Now, we can predict the risk classification for a new data set:
xgNew = XGpred_predict(newdat = vdat, XGpredObj = xgobj)
#' # To delete the "temp_dir", use the following:
unlink(temp_dir)