createWorkbench: Workbench constructor

createWorkbenchR Documentation

Workbench constructor

Description

This function creates a GROAN.Workbench instance (or fails trying). The created object contains:
a) one regressor with its own specific configuration
b) the experiment parameters (number of repetitions, number of folds in case of crossvalidation, stratification...)
You can have a general description of the created object using the overridden print.GROAN.Workbench function.
It is possible to add other regressors to the created GROAN.Workbench object using addRegressor. Once the GROAN.Workbench is created it must be passed to GROAN.run to start the experiment.

Usage

createWorkbench(
  folds = 10,
  reps = 5,
  stratified = FALSE,
  outfolder = NULL,
  outfile.name = "accuracy.csv",
  saveHyperParms = FALSE,
  saveExtraData = FALSE,
  regressor = phenoRegressor.rrBLUP,
  regressor.name = "default regressor",
  ...
)

Arguments

folds

number of folds for crossvalidation, defaults to 10. If NULL no crossvalidation happens and all training data will be used. In this case a second dataset, for test, is needed (see GROAN.run for details)

reps

number of times the whole test must be repeated, defaults to 5

stratified

boolean indicating whether GROAN should take into account data strata. This have two effects. First, the crossvalidation becomes stratified, meaning that folds will be split so that training and test sets will contain the same proportions of each data stratum. Second, prediction accuracy will be assessed (also) by strata. If no strata are present in the GROAN.NoisyDataSet object and stratified==TRUE all samples will be considered belonging to the same strata ("dummyStrata"). If stratified is FALSE (the default) GROAN will simply ignore the strata, even if present in the GROAN.NoisyDataSet.

outfolder

folder where to save the data. If NULL (the default) nothing will be saved. Filenames are standardized. If existing, accuracy and hyperparameter files will be updated, otherwise are created. ExtraData cannot be updated, so unique filenames will be generated using runId (see GROAN.run)

outfile.name

file name to be used to save the accuracies in a text file. Defaults to "accuracy.csv". Ignored if outfolder is NULL

saveHyperParms

boolean indicating if the hyperparameters from regressor training should be saved in outfolder. Defaults to FALSE.

saveExtraData

boolean indicating if extradata from regressor training should be saved in outfolder as R objects (using the save function). Defaults to FALSE.

regressor

regressor function. Defaults to phenoRegressor.rrBLUP

regressor.name

string that will be used in reports. Keep that in mind when deciding names. Defaults to "default regressor"

...

extra parameter are passed to regressor function

Value

An instance of GROAN.Workbench

See Also

addRegressor GROAN.run createNoisyDataset

Examples

#creating a Workbench with all default arguments
wb1 = createWorkbench()
#another Workbench, with different crossvalidation
wb2 = createWorkbench(folds=5, reps=20)
#a third one, with a different regressor and extra parameters passed to regressor function
wb3 = createWorkbench(regressor=phenoRegressor.BGLR, regressor.name='Bayesian Lasso', type='BL')

GROAN documentation built on Nov. 28, 2022, 5:07 p.m.