Learn R Programming

Coxmos (version 1.1.2)

predict.Coxmos: predict.Coxmos

Description

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.

Usage

# S3 method for Coxmos
predict(object, ..., newdata = NULL)

Value

Score values data.frame for new data using the Coxmos model selected.

Arguments

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.

Author

Pedro Salguero Garcia. Maintainer: pedsalga@upv.edu.es

Details

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.

Examples

Run this code
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)

Run the code above in your browser using DataLab