fitMPRModel: fitMPRModel

View source: R/model_fitting.R

fitMPRModelR Documentation

fitMPRModel

Description

fitMPRModel

Usage

fitMPRModel(
  type,
  method,
  trainXs,
  trainY,
  testXs = NULL,
  testY = NULL,
  tteColname = "time_to_event",
  eventColname = "Event",
  parallel = FALSE,
  seed = NULL,
  save = TRUE,
  saveSuffix = NULL,
  ...
)

Arguments

type

A string representing the type of model. Can be 'binary', 'survival' or 'continuous'.

method

The modelling method. Currently supports 'glmnet', 'bart' and 'rf'.

trainXs

The training data matrix/data.frame.

trainY

The training response variable. This should be a vector if type = 'binary'/'continuous' or a data.frame/matrix with column names corresponding to tteColname and eventColname if type = 'survival'.

testXs

The test data matrix/data.frame.

testY

The test response variable. This should be a vector if type = 'binary'/'continuous' or a data.frame/matrix with column names corresponding to tteColname and eventColname if type = 'survival'.

tteColname

A string corresponding to the time-to-event column name in trainY/testY. Only required if type == 'survival'.

eventColname

A string corresponding to the event column name in trainY/testY. Only required if type == 'survival'.

parallel

A boolean specifying whether parallel computation should be used in model fitting.

seed

An integer to set the random seed to for model fitting.

save

A boolean specifying if the model object should be saved to the logs.

saveSuffix

Optional - a custom suffix to include in the file name of the saved model object after the timestamp.

...

Other arguments to be passed to the method-specific fitting function.

Value

A MPRModel object with the fitted model.


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