PrognosticModel: Prognostic Model construction

View source: R/PrognosticModel.R

PrognosticModelR Documentation

Prognostic Model construction

Description

Prognostic Model construction

Usage

PrognosticModel(
  x,
  y,
  scale = FALSE,
  seed = 123456,
  train_ratio = 0.7,
  nfold = 10,
  plot = T
)

Arguments

x

input matrix or data.frame where samples are in rows and features in columns; The first column of x is the sample ID of which column is "ID".

y

input matrix or data.frame with three column. Column names are "ID", "time", "status"

scale

A logistic: should the x be scaled, default is TRUE.

seed

default 123456

train_ratio

Value between 0-1; The ratio was used to split the x and y into training and testing data.

nfold

nfold default 10

plot

A logistic, default is TRUE.

Value

a list contain the results of 2 model (Lasso, Ridge) and the input train data.

Examples

data("imvigor210_sig", package = "IOBR")
data("imvigor210_pdata",package = "IOBR")
pdata_prog <- imvigor210_pdata %>% dplyr::select(ID, OS_days, OS_status) %>% mutate(OS_days = as.numeric(.$OS_days)) %>% mutate(OS_status = as.numeric(.$OS_status))
prognostic_result <- PrognosticModel(x = imvigor210_sig, y = pdata_prog, scale = T, seed  = 123456, train_ratio = 0.7, nfold = 10, plot = T)


IOBR/IOBR documentation built on May 5, 2024, 2:34 p.m.