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

View source: R/pipeline_modules.R

fitLogisticModelR 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. Fits a penalised logistic regression model with cross-validation.

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. Fits a penalised logistic regression model with cross-validation.

Usage

fitLogisticModel(
  xs,
  y,
  penalty,
  weights,
  nFoldsCV = 3,
  foldID = NULL,
  pipelineRunInformation,
  modelLabel,
  prescaled = FALSE,
  typeMeasure = "default",
  penaltyFactor = NULL
)

Arguments

xs

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

y

A matrix/data.frame with a column named 'Event' corresponding to a binary label.

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 in the 'penalty' and 'number of folds' entries in pipeline.run.information. It will also 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

typeMeasure

A string specifying the argument to type.measure in cv.glmnet. Defaults to 'default'.

penaltyFactor

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

Value

The glmnet logistic model object.


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