Lrner | R Documentation |
This class implements a learner. A Lrner object can only exist as a component of a TrainLayer or a TrainMetaLayer object.
new()
Initialize a default parameters list.
Lrner$new( id, package = NULL, lrn_fct, param_train_list, param_pred_list = list(), train_layer, na_action = "na.rm" )
id
character
Learner ID.
package
character
Package that implements the learn function. If NULL, the
lrn_fct
character
learn function is called from the current environment.
param_train_list
list
List of parameter for training.
param_pred_list
list
List of parameter for testing.
Learn parameters.
train_layer
TrainLayer
Layer on which the learner is stored.
na_action
character
Handling of missing values. Set to "na.keep" to keep missing values, "na.rm" to remove individuals with missing values or "na.impute" (only applicable on meta-data) to impute missing values in meta-data. Only median and mode based imputations are actually handled. With the "na.keep" option, ensure that the provided learner can handle missing values.
print()
Printer
Lrner$print(...)
...
any
summary()
Printer
Lrner$summary(...)
...
any
interface()
Learner and prediction parameter interface. Use this function
to provide how the following parameters are named in the learning
function (lrn_fct
) you provided when creating the learner, or in the predicting function.
Lrner$interface( x = "x", y = "y", object = "object", data = "data", extract_pred_fct = NULL )
x
character
Name of the argument to pass the matrix of independent variables in the original learning function.
y
character
Name of the argument to pass the response variable in the original learning function.
object
character
Name of the argument to pass the model in the original predicting function.
data
character
Name of the argument to pass new data in the original predicting function.
extract_pred_fct
character
or function
If the predict function that is called for the model does not return a vector, then
use this argument to specify a (or a name of a) function that can be used to extract vector of predictions.
Default value is NULL, if predictions are in a vector.
train()
Tains the current learner (from class Lrner) on the current training data (from class TrainData).
Lrner$train(ind_subset = NULL, use_var_sel = FALSE, verbose = TRUE)
ind_subset
vector
Individual ID subset on which the training will be performed.
use_var_sel
boolean
If TRUE, variable selection is performed before training.
verbose
boolean
Warning messages will be displayed if set to TRUE.
The resulting model, from class Model, is returned.
getTrainLayer()
The current layer is returned.
Lrner$getTrainLayer()
TrainLayer object.
getNaRm()
The current layer is returned.
Lrner$getNaRm()
getNaAction()
The current layer is returned.
Lrner$getNaAction()
getId()
Getter of the current learner ID.
Lrner$getId()
The current learner ID.
getPackage()
Getter of the learner package implementing the learn function.
Lrner$getPackage()
The name of the package implementing the learn function.
getIndSubset()
Getter of the learner package implementing the learn function.
Lrner$getIndSubset()
The name of the package implementing the learn function.
getVarSubset()
Getter of the variable subset used for training.
Lrner$getVarSubset()
The list of variables used for training is returned.
getParamPred()
Getter predicting parameter list.
Lrner$getParamPred()
The list of predicting parameters.
getParamInterface()
The current parameter interface is returned.
Lrner$getParamInterface()
A data.frame of interface.
getExtractPred()
The function to extract predicted values is returned.
Lrner$getExtractPred()
A data.frame of interface.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.