Trainer Class An S4 class representing a learning method.
Source:R/class_Trainer.R
Trainer-class.Rd
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
. Seesupported_learning_methods()
for the supported methods.- trainer
(optional) function to train a model. Used if
id
is not one of the supported by renoir. Iftrainer
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
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