Trainer Class An S4 class representing a learning method.
Source:R/class_Trainer.R
Trainer-class.RdThe 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
idis not one of the supported by renoir. Iftraineris 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
idthe learning method name
trainertrainer 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
parameterslist containing the parameters for the chosen learning method
loggera Logger