View source: R/Coxmos_common_functions.R
predict.Coxmos | R Documentation |
Generates the prediction score matrix for Partial Least Squares (PLS) Survival models, facilitating the transformation of high-dimensional data into a reduced space while preserving the most relevant information for survival analysis.
## S3 method for class 'Coxmos'
predict(object, ..., newdata = NULL)
object |
Coxmos model |
... |
additional arguments affecting the predictions produced. |
newdata |
Numeric matrix or data.frame. New data for explanatory variables (raw data). Qualitative variables must be transform into binary variables. |
The predict.Coxmos
function is designed to compute the prediction scores for new data
based on a previously trained PLS Survival model. The function leverages the dimensional reduction
capabilities of PLS to project the new data into a lower-dimensional space, which is particularly
beneficial when dealing with high-dimensional datasets in survival analysis. The score matrix
obtained serves as a compact representation of the original data, capturing the most salient
features that influence survival outcomes.
Score values data.frame for new data using the Coxmos model selected.
Pedro Salguero Garcia. Maintainer: pedsalga@upv.edu.es
data("X_proteomic")
data("Y_proteomic")
set.seed(123)
index_train <- caret::createDataPartition(Y_proteomic$event, p = .5, list = FALSE, times = 1)
X_train <- X_proteomic[index_train,1:50]
Y_train <- Y_proteomic[index_train,]
X_test <- X_proteomic[-index_train,1:50]
Y_test <- Y_proteomic[-index_train,]
model <- splsicox(X_train, Y_train, n.comp = 2) #after CV
predict(object = model, newdata = X_test)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.