Learn R Programming

FIT (version 0.0.6)

make.recipe: Creates a recipe for training models.

Description

Creates a recipe for training models.

Usage

make.recipe(envs, init, optim, fit, init.data, time.step, gate.open.min = 0,
  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.

gate.open.min

The minimum opning length in minutes of the gate function for environmental inputs.

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

Run this code
# 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)))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab