TrainMetaLayer: TrainMetaLayer Class

TrainMetaLayerR Documentation

TrainMetaLayer Class

Description

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.

Super class

fuseMLR::HashTable -> TrainMetaLayer

Methods

Public methods

Inherited methods

Method new()

constructor

Usage
TrainMetaLayer$new(id, training)
Arguments
id

character
Id of training meta-layer.

training

Training


Method print()

Printer

Usage
TrainMetaLayer$print(...)
Arguments
...

any


Method getTraining()

Getter of the current training object.

Usage
TrainMetaLayer$getTraining()
Returns

The current training object is returned.


Method getTargetObj()

Getter of the target object.

Usage
TrainMetaLayer$getTargetObj()

Method train()

Trains the current layer.

Usage
TrainMetaLayer$train(ind_subset = NULL, verbose = TRUE)
Arguments
ind_subset

vector
ID subset of individuals to be used for training.

verbose

boolean
Warning messages will be displayed if set to TRUE.

Returns

The current layer is returned with the resulting model.


Method predict()

Predicts values for the new layer taking as argument.

Usage
TrainMetaLayer$predict(new_layer, ind_subset = NULL)
Arguments
new_layer

TrainLayer
A trained TrainLayer object.

ind_subset

vector
Index subset.

Returns

A new object with the predicted values is returned.


Method impute()

Imputes missing values in modality-specific predictions. Only mode and median based imputations are actually supported.

Usage
TrainMetaLayer$impute(impute_fct = NULL, impute_param = NULL)
Arguments
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!

Returns

A new object with the predicted values is returned.


Method getTrainData()

Getter of the training dataset stored on the current layer.

Usage
TrainMetaLayer$getTrainData()
Returns

The stored TrainData object is returned.


Method getLrner()

Getter of the learner.

Usage
TrainMetaLayer$getLrner()
Returns

The stored Lrner object is returned.


Method getModel()

Getter of the model.

Usage
TrainMetaLayer$getModel()
Returns

The stored Model object is returned.


Method openAccess()

Open access to the meta layer. A meta learner is only modifiable if the access is opened.

Usage
TrainMetaLayer$openAccess()

Method closeAccess()

Close access to the meta layer to avoid accidental modification.

Usage
TrainMetaLayer$closeAccess()

Method getAccess()

Getter of the current access to the meta layer.

Usage
TrainMetaLayer$getAccess()

Method setTrainData()

Create and set an TrainData object to the current meta learner.

Usage
TrainMetaLayer$setTrainData(id, ind_col, data_frame)
Arguments
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.


Method checkLrnerExist()

Check whether a training data has been already stored.

Usage
TrainMetaLayer$checkLrnerExist()
Returns

Boolean value


Method checkModelExist()

Check whether a model has been already stored.

Usage
TrainMetaLayer$checkModelExist()
Returns

Boolean value


Method checkTrainDataExist()

Check whether a training data has been already stored.

Usage
TrainMetaLayer$checkTrainDataExist()
Returns

Boolean value


Method set2NotTrained()

Only usefull to reset status FALSE after cross validation.

Usage
TrainMetaLayer$set2NotTrained()

Method summary()

Generate summary.

Usage
TrainMetaLayer$summary()

fuseMLR documentation built on April 3, 2025, 8:49 p.m.