Creates a recipe for training models.

Share:

Description

Creates a recipe for training models.

Usage

1
make.recipe(envs, init, optim, fit, init.data, time.step, opts = NULL)

Arguments

envs

An array of weather factors to be taken into account during the construction of models. At the moment, the array envs can only contain a single weather factor from weather.entries, though there is a plan to remove the restriction in a future version.

init

A string to specify the method to choose the initial parameters. (One of 'gridsearch' or 'manual'.)

optim

A string to specify the method to be used for optimizing the model parameters. (One of 'none', 'lm' or 'lasso')

fit

A string to specify the method to be used for fixing the linear regression coefficients. (One of 'fit.lm' or 'fit.lasso'.)

init.data

Auxiliary data needed to perform the Init stage using the method specified by the init argument. When init is 'gridsearch', it should be a list representing a discretized parameter space. When init is 'manual', it should be a list of parameter values that is used as the initial values for the parameters in the Optim stage.

time.step

An integer to specify the basic unit of time (in minute) for the transcriptomic models. Must be a multiple of the time step of weather data.

opts

An optional named list that specifies the arguments to be passed to methods that constitute each stage of the model training. Each key of the list corresponds to a name of a method.

See examples for the supported options.

Value

An object representing the procedure to construct models.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
init.params <- .. # choose them wisely
# Defined in Train.R:
# default.opts <- list(
#   none  = list(),
#   lm    = list(maxit=1500, nfolds=-1), # nfolds for lm is simply ignored
#   lasso = list(maxit=1000, nfolds=10)
# )
recipe <- FIT::make.recipe(c('wind', 'temperature'),
                           init = 'manual',
                           init.data = init.params,
                           optim = c('lm', 'none', 'lasso'),
                           fit = 'fit.lasso',
                           time.step = 10,
                           opts =
                             list(lm    = list(maxit = 900),
                                  lasso = list(maxit = 1000)))

## End(Not run)