createTrainMetaLayer: createTrainMetaLayer

createTrainMetaLayerR Documentation

createTrainMetaLayer

Description

Creates and store a TrainMetaLayer on the Training object passed as argument. The meta-layer encapsulates the meta-learner and the fold predictions (internally created) of the layer-specific base models.

Usage

createTrainMetaLayer(
  training,
  meta_layer_id,
  lrner_package = NULL,
  lrn_fct,
  param_train_list = list(),
  param_pred_list = list(),
  na_action = "na.impute",
  x_lrn = "x",
  y_lrn = "y",
  object = "object",
  data = "data",
  extract_pred_fct = NULL
)

Arguments

training

Training
Training object for storing the created meta-layer.

meta_layer_id

character
ID of the layer to be created.

lrner_package

character
Package name containing the variable selection algorithm function. Defaults to NULL if the function exists in the current working environment.

lrn_fct

character
Name of the learning function. The function must accept at least two parameters: x (predictors) and y (response values), and return a model. If not, use the interface parameters x_lrn and y_lrn below to map these argument names to the original arguments in your function. The returned model must support the generic predict function (with arguments object and data) to make predictions for new data, and the predictions should be a vector or a list containing a vector called predictions with the predicted values. If the arguments object and data are named differently in your predict function, use the interface parameters object and data below to specify the original names. See the details below about meta-learners.

param_train_list

character
List of arguments to be passed to lrn_fct.

param_pred_list

list
List of arguments to be passed to predict when computing predictions.

na_action

character
Handling of missing values in modality-specific predictions during training. Set to "na.keep" to keep missing values, "na.rm" to remove individuals with missing values or "na.impute" to impute missing values in modality-specific predictions. Only median and mode based imputations are actually handled. With the "na.keep" option, ensure that the provided meta-learner can handle missing values.

x_lrn

character
If the argument name used by the provided original function to pass the matrix of independent variables is not x, use this argument to specify the name used in the function.

y_lrn

character
If the argument name used by the provided original function to pass the target variable is not y, use this argument to specify the name used in the function.

object

character
The generic function predict uses a parameter object to pass a model. If the corresponding argument is named differently in your predict function, specify the name.

data

character
The generic function predict uses a parameter data to pass new data. If the corresponding argument is named differently in your predict function, specify the name.

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. Defaults to NULL, if predictions are a vector.

Details

Internal meta-learners are available in the package.

The cobra meta-learner implements the COBRA (COmBined Regression Alternative), an aggregation method for combining predictions from multiple individual learners (Biau et al. 2014). This method aims to tune key parameters for achieving optimal predictions by averaging the target values of similar candidates in the training dataset's predictions. Only the training points that are sufficiently similar to the test point (based on the proximity threshold epsilon) are used for prediction. If no suitable training points are found, the function returns NA.

The weightedMeanLearner evaluates the prediction performance of modality-specific learners and uses these estimates to weight the base models, aggregating their predictions accordingly.

The bestLayerLearner evaluates the prediction performance of modality-specific learners and returns predictions made by the best learner as the meta-prediction.

Beyond the internal meta-learners, any other learning algorithm can be used.

Value

The updated Training object (with the new layer) is returned.

References

Fouodo C.J.K, Bleskina M. and Szymczak S. (2024). fuseMLR: An R package for integrative prediction modeling of multi-omics data, paper submitted.
Biau, G., Fischer, A., Guedj, B., & Malley, J. D. (2014). COBRA: A combined regression strategy. The Journal of Multivariate Analysis 46:18-28

See Also

createTrainLayer, varSelection, and fusemlr.


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