TrainLayer: TrainLayer Class

TrainLayerR Documentation

TrainLayer Class

Description

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.

Super class

fuseMLR::HashTable -> TrainLayer

Methods

Public methods

Inherited methods

Method new()

constructor

Usage
TrainLayer$new(id, training)
Arguments
id

character
Training layer id.

training

Training


Method print()

Printer

Usage
TrainLayer$print(...)
Arguments
...

any


Method getTraining()

Getter of the current training object.

Usage
TrainLayer$getTraining()
Returns

The current training object is returned.


Method getTargetObj()

Getter of the target object.

Usage
TrainLayer$getTargetObj()

Method train()

Trains the current layer.

Usage
TrainLayer$train(ind_subset = NULL, use_var_sel = FALSE, verbose = TRUE)
Arguments
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.

Returns

The current layer is returned with the resulting model.


Method varSelection()

Variable selection on the current layer.

Usage
TrainLayer$varSelection(ind_subset = NULL, verbose = TRUE)
Arguments
ind_subset

vector
ID subset of individuals to be used for variable selection.

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
TrainLayer$predict(new_layer, use_var_sel, ind_subset = NULL)
Arguments
new_layer

TrainLayer

use_var_sel

boolean
If TRUE, selected variables available at each layer are used.

ind_subset

vector

Returns

A new PredictLayer object with the predicted data is returned.


Method getTrainData()

Getter of the training dataset stored on the current layer.

Usage
TrainLayer$getTrainData()
Returns

The stored TrainData object is returned.


Method getTargetValues()

Getter of target values from the current layer.

Usage
TrainLayer$getTargetValues()
Returns

A data.frame containing individuals IDs and corresponding target values.


Method getIndIDs()

Getter of IDS from the current layer.

Usage
TrainLayer$getIndIDs()
Returns

A data.frame containing individuals IDs values.


Method getTestData()

Getter of the new data.

Usage
TrainLayer$getTestData()
Returns

The stored TestData object is returned.


Method getLrner()

Getter of the learner.

Usage
TrainLayer$getLrner()
Returns

The stored Lrner object is returned.


Method getVarSel()

Getter of the variable selector.

Usage
TrainLayer$getVarSel()
Returns

The stored VarSel object is returned.


Method getModel()

Getter of the model.

Usage
TrainLayer$getModel()
Returns

The stored Model object is returned.


Method checkLrnerExist()

Check whether a learner has been already stored.

Usage
TrainLayer$checkLrnerExist()
Returns

Boolean value


Method checkModelExist()

Check whether a model has been already stored.

Usage
TrainLayer$checkModelExist()
Returns

Boolean value


Method checkVarSelExist()

Check whether a variable selection tool has been already stored.

Usage
TrainLayer$checkVarSelExist()
Returns

Boolean value


Method checkTrainDataExist()

Check whether a training data has been already stored.

Usage
TrainLayer$checkTrainDataExist()
Returns

Boolean value


Method summary()

Generate summary.

Usage
TrainLayer$summary()

See Also

Training, Lrner, TrainData, TestData and Model


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