TrainMetaLayer | R Documentation |
This class implement a meta meta layer. A TrainMetaLayer can only exist as unique element of a Training object.
A layer is structured as followed:
Lrner: It is set by the user to be trained on the meta training data.
TrainData: It are modality-specific prediction data, automatically created by the internal cross validation.
Model: The meta model, result of training the learner on the training data, and therefore, not to be set by the user.
TestData: The meta new data to be predicted, consisting in predictions obtained from each layer.
A meta layer can train its meta learner on the meta training data and store the resulting meta model. The meta layer can predict values given a new meta layer.
fuseMLR::HashTable
-> TrainMetaLayer
new()
constructor
TrainMetaLayer$new(id, training)
id
character
Id of training meta-layer.
training
Training
print()
Printer
TrainMetaLayer$print(...)
...
any
getTraining()
Getter of the current training object.
TrainMetaLayer$getTraining()
The current training object is returned.
getTargetObj()
Getter of the target object.
TrainMetaLayer$getTargetObj()
train()
Trains the current layer.
TrainMetaLayer$train(ind_subset = NULL, verbose = TRUE)
ind_subset
vector
ID subset of individuals to be used for training.
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.
TrainMetaLayer$predict(new_layer, ind_subset = NULL)
new_layer
TrainLayer
A trained TrainLayer object.
ind_subset
vector
Index subset.
A new object with the predicted values is returned.
impute()
Imputes missing values in modality-specific predictions. Only mode and median based imputations are actually supported.
TrainMetaLayer$impute(impute_fct = NULL, impute_param = NULL)
impute_fct
character
An imputation function to use instead of median or mode imputation.
This parameter is actually not used.
This corresponds to median or mode based imputation.
impute_param
list
The list of parameters to call the imputation function. Not yet implemented!
A new object with the predicted values is returned.
getTrainData()
Getter of the training dataset stored on the current layer.
TrainMetaLayer$getTrainData()
The stored TrainData object is returned.
getLrner()
Getter of the learner.
TrainMetaLayer$getLrner()
The stored Lrner object is returned.
getModel()
Getter of the model.
TrainMetaLayer$getModel()
The stored Model object is returned.
openAccess()
Open access to the meta layer. A meta learner is only modifiable if the access is opened.
TrainMetaLayer$openAccess()
closeAccess()
Close access to the meta layer to avoid accidental modification.
TrainMetaLayer$closeAccess()
getAccess()
Getter of the current access to the meta layer.
TrainMetaLayer$getAccess()
setTrainData()
Create and set an TrainData object to the current meta learner.
TrainMetaLayer$setTrainData(id, ind_col, data_frame)
id
character
ID of the TrainData object to be instanciated.
ind_col
character
Name of individual column IDs.
data_frame
data.frame
data.frame
of layer specific predictions.
checkLrnerExist()
Check whether a training data has been already stored.
TrainMetaLayer$checkLrnerExist()
Boolean value
checkModelExist()
Check whether a model has been already stored.
TrainMetaLayer$checkModelExist()
Boolean value
checkTrainDataExist()
Check whether a training data has been already stored.
TrainMetaLayer$checkTrainDataExist()
Boolean value
set2NotTrained()
Only usefull to reset status FALSE after cross validation.
TrainMetaLayer$set2NotTrained()
summary()
Generate summary.
TrainMetaLayer$summary()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.