TrainLayer | R Documentation |
This class implements a traning layer. A TrainLayer object can only exist as a component of a Training object.
A training layer is structured as followed:
TrainData: Data to be used to train the learner.
Lrner: Includes a learning function and the package implementing the function.
Model: The result of training the learner on the training data.
VarSel: Includes a variable selection function and the package implementing the function.
A training layer can train its learner on its training data and store the resulting model. See the public function Layer$train()
below.
A training layer can make predictions for a new layer passed as argument to its predict function. See the public function Layer$predict()
below.
fuseMLR::HashTable
-> TrainLayer
new()
constructor
TrainLayer$new(id, training)
id
character
Training layer id.
training
Training
print()
Printer
TrainLayer$print(...)
...
any
getTraining()
Getter of the current training object.
TrainLayer$getTraining()
The current training object is returned.
getTargetObj()
Getter of the target object.
TrainLayer$getTargetObj()
train()
Trains the current layer.
TrainLayer$train(ind_subset = NULL, use_var_sel = FALSE, verbose = TRUE)
ind_subset
vector
ID subset of individuals to be used for training.
use_var_sel
boolean
If TRUE, variable selection is performed before training.
verbose
boolean
Warning messages will be displayed if set to TRUE.
The current layer is returned with the resulting model.
varSelection()
Variable selection on the current layer.
TrainLayer$varSelection(ind_subset = NULL, verbose = TRUE)
ind_subset
vector
ID subset of individuals to be used for variable selection.
verbose
boolean
Warning messages will be displayed if set to TRUE.
The current layer is returned with the resulting model.
predict()
Predicts values for the new layer taking as argument.
TrainLayer$predict(new_layer, use_var_sel, ind_subset = NULL)
new_layer
TrainLayer
use_var_sel
boolean
If TRUE, selected variables available at each layer are used.
ind_subset
vector
A new PredictLayer object with the predicted data is returned.
getTrainData()
Getter of the training dataset stored on the current layer.
TrainLayer$getTrainData()
The stored TrainData object is returned.
getTargetValues()
Getter of target values from the current layer.
TrainLayer$getTargetValues()
A data.frame
containing individuals IDs and corresponding target values.
getIndIDs()
Getter of IDS from the current layer.
TrainLayer$getIndIDs()
A data.frame
containing individuals IDs values.
getTestData()
Getter of the new data.
TrainLayer$getTestData()
The stored TestData object is returned.
getLrner()
Getter of the learner.
TrainLayer$getLrner()
The stored Lrner object is returned.
getVarSel()
Getter of the variable selector.
TrainLayer$getVarSel()
The stored VarSel object is returned.
getModel()
Getter of the model.
TrainLayer$getModel()
The stored Model object is returned.
checkLrnerExist()
Check whether a learner has been already stored.
TrainLayer$checkLrnerExist()
Boolean value
checkModelExist()
Check whether a model has been already stored.
TrainLayer$checkModelExist()
Boolean value
checkVarSelExist()
Check whether a variable selection tool has been already stored.
TrainLayer$checkVarSelExist()
Boolean value
checkTrainDataExist()
Check whether a training data has been already stored.
TrainLayer$checkTrainDataExist()
Boolean value
summary()
Generate summary.
TrainLayer$summary()
Training, Lrner, TrainData, TestData and Model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.