fitCoxModel: This function is for an older version of MethylPipeR and is...

View source: R/pipeline_modules.R

fitCoxModelR Documentation

This function is for an older version of MethylPipeR and is now deprecated. It is currently still included to allow old scripts to run correctly. Fit glmnet penalised cox model on training data.

Description

This function is for an older version of MethylPipeR and is now deprecated. It is currently still included to allow old scripts to run correctly. Fit glmnet penalised cox model on training data.

Usage

fitCoxModel(
  xs,
  target,
  penalty,
  weights,
  nFoldsCV = 3,
  foldID = FALSE,
  pipelineRunInformation,
  modelLabel,
  prescaled = FALSE,
  penaltyFactor = NULL
)

Arguments

xs

A matrix/data.frame corresponding to X variables. Columns should correspond to features.

target

A matrix/data.frame with columns named 'Event' and 'time_to_event'. 'Event' should correspond to a binary label. 'time_to_event' should correspond to a positive numerical value representing the survival time (when Event == 1) or the time-to-censoring (when Event == 0)

penalty

'lasso'/'elnet'/'ridge' A string specifying the penalty.

weights

A vector of weights corresponding to the training data rows to be used in model fitting.

nFoldsCV

The number of folds to be used in cross-validation (default is 3)

foldID

A vector of numbers specifying a cross-validation fold. Each entry should correspond to a row in xs.

pipelineRunInformation

The object originally created by beginPipelineRun.

modelLabel

A string that will act as a label for this function call. The label will be used as a prefix for the saved object filenames in this function call.

prescaled

A boolean specifying if the columns in xs have been scaled before the call to fitLogisticModel e.g. using scale(). If set to TRUE, this sets standardize = FALSE in the internal call to cv.glmnet

penaltyFactor

A vector of numbers indicating variable-specific weights for the lambda penalty.

Value

The fit penalised cox model glmnet object.


marioni-group/MethylPipeR documentation built on Oct. 10, 2024, 3:32 p.m.