Skip to contents

The object consists of 4 slots

Constructor for the S4 Trainer object.

Usage

Trainer(id, trainer, parameters, logger = Logger())

Arguments

id

the learning method name associated to this Trainer. If learning method is one of the supported by renoir, the constructor will automatically select a trainer. See supported_learning_methods() for the supported methods.

trainer

(optional) function to train a model. Used if id is not one of the supported by renoir. If trainer is provided it must conform to the renoir common interface, and must have the following formal arguments:

x

the input matrix, where rows are observations and columns are variables.

y

the response variable. Its number of rows must match the number of rows of x.

weights

priors of the observations

offset

used only for GLM methods, it is an a priori known component to be included in the linear predictor during fitting

resp.type

the response type

observations

indices of observations to keep

features

indices of predictors to keep

...

additional arguments

parameters

list containing the parameters for the chosen learning method

logger

a Logger

Value

An object of class Trainer.

Slots

id

the learning method name

trainer

trainer function. It must have the following formal arguments:

x

the input matrix, where rows are observations and columns are variables.

y

the response variable. Its number of rows must match the number of rows of x.

weights

priors of the observations

offset

used only for GLM methods, it is an a priori known component to be included in the linear predictor during fitting

resp.type

the response type

observations

indices of observations to keep

features

indices of predictors to keep

...

additional arguments

parameters

list containing the parameters for the chosen learning method

logger

a Logger

Author

Alessandro Barberis