diff --git a/R/testingFunctions.R b/R/testingFunctions.R index 95ab035..c83d5b6 100644 --- a/R/testingFunctions.R +++ b/R/testingFunctions.R @@ -5,9 +5,9 @@ #' @param id `character` \cr #' Testing id. #' @param ind_col `character` \cr -#' Name of column of individuals IDs in testing data.frame. +#' Name of column of individuals IDs in testing `data.frame`. #' @param verbose `boolean` \cr -#' Warning messages will be displayed if set to TRUE. +#' Warning messages will be displayed if set to `TRUE`. #' @return #' A [Testing] object. #' @export @@ -25,7 +25,7 @@ createTesting = function (id, #' @title createTestLayer #' @description -#' Creates and store a [TestLayer] on the [Testing] object passed as argument. +#' Creates and stores a [TestLayer] on the [Testing] object passed as argument. #' #' @param testing `Testing` \cr #' Testing object where the created layer will be stored. @@ -57,7 +57,7 @@ createTestLayer = function (testing, #' @title Testing object Summaries #' @description -#' Summaries a fuseMLR [Testing] object. +#' Summaries a `fuseMLR` [Testing] object. #' #' @param object `Testing` \cr #' The [Testing] object of interest. diff --git a/R/trainingFunctions.R b/R/trainingFunctions.R index 99ae4de..6d7459e 100644 --- a/R/trainingFunctions.R +++ b/R/trainingFunctions.R @@ -44,54 +44,64 @@ createTraining = function (id, #' selection methods, and a modality-specific learner. #' #' @param training `Training` \cr -#' Training object where the created layer will be stored. +#' Training object for storing the created layer. #' @param train_layer_id `character` \cr #' ID of the [TrainLayer] to be created. #' @param train_data `data.frame` \cr -#' Data modality to be stored in [TrainData]. +#' Data modality to be stored on the layer. #' @param varsel_package `character` \cr -#' Name of the package containing the function that implements the variable selection algorithm.\cr +#' Package name containing the variable selection algorithm function. +#' Defaults to `NULL` if the function exists in the current working environment.\cr #' @param varsel_fct `character` \cr -#' Name of variable selection function. Default value is `NULL` for no variable selection. -#' If specified, the function must allow at least two parameters `x` (of predictors) -#' and `y` (response values), and return a vector of selected variables. Otherwise use the interface parameters -#' `x_varsel`, `y_varsel` below to map the original argument names, and `extract_var_fct` indicate how to extract the vector of selected variables. -#' An exception, however, is made for the Boruta function, for which an internal adjustment is implemented; its use requires no further modifications. +#' Variable selection function name. Default value is `NULL` for no variable selection. +#' If specified, the function must accept at least two parameters: `x` (predictors) +#' and `y` (response values), and return a vector of selected variables. +#' Alternatively, use the interface parameters `x_varsel` and `y_varsel` to map +#' the original argument names, and `extract_var_fct` to specify how to extract +#' the vector of selected variables. An exception is made for the `Boruta` function, +#' which includes an internal adjustment and requires no additional modifications. #' @param varsel_param `list` \cr #' List of arguments to be passed to \code{varsel_fct}. #' @param lrner_package `character` \cr -#' Name of the package containing the function that implements the learning algorithm. -#' Default is `NULL`, if the function is available in the current working environment. +#' Name of the package containing the learning algorithm function. Defaults to +#' `NULL` if the function is available in the current working environment. #' @param lrn_fct `character` \cr -#' Name of the learning function. The corresponding function must allow at least two parameters `x` (of predictors) -#' and `y` (response values), and return a model. Otherwise, the interface -#' parameters `x_lrn` and `y_lrn` below can be used to map these argument name with the original arguments in your function. -#' The returned model must allow the use of the generic function `predict` (with arguments `object` and `data`) to make -#' predictions for new data and 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. In addition, if -#' predictions are stored as a `matrix` or a `data.frame` (e.g. predicted probabilities for different classes in dichotomous classification), -#' only the second column (assumed to be the class `1` probabilities) will be considered. If the predicted values are not returned in one of the formats above, -#' use the argument `extract_pred_fct` below to specify how the predicted values can be extracted from the predicted object. +#' Name of the learning function. The function must accept at least two parameters: +#' `x` (predictors) and `y` (response values) and return a model. Alternatively, +#' use the interface parameters `x_lrn` and `y_lrn` to map these names to the +#' original arguments in your function. +#' The returned model must support the generic `predict` function (with arguments +#' `object` and `data`) to generate predictions for new data. Predictions should +#' be either a vector or a `list` containing a vector named `predictions` with +#' the predicted values.\cr +#' If the arguments `object` and `data` have different names in your `predict` +#' function, use the interface parameters below to map them to the original names. +#' Additionally, if predictions are stored as a `matrix` or `data.frame` +#' (e.g., predicted probabilities for dichotomous classification), only the second +#' column (assumed to be class `1` probabilities) will be used. +#' If the predicted values are not returned in one of the formats mentioned above, +#' use the `extract_pred_fct` argument below to specify how to extract the predicted +#' values from the prediction object. #' @param param_train_list `character` \cr #' List of arguments to be passed to \code{lrn_fct}. #' @param param_pred_list `character` \cr -#' List of arguments to be passed to \code{predict} when computing predictions. +#' List of arguments to be passed to \code{predict} when generating predictions. #' @param na_action `character`\cr -#' Handling of missing values in data a modality during training. Set to "na.keep" to keep missing values, or "na.rm" to remove individuals with missing values. Imputation of missing values in data modalities is not yet handled. +#' Handling of missing values in data during training. Set to `"na.keep"` to retain +#' missing values, or `"na.rm"` to remove instances with missing values. #' @param object `character` \cr -#' The generic function \code{predict} uses a parameter \code{object} to pass a model. -#' If the corresponding argument is named differently in your predict function, specify the name. +#' The generic function `predict` uses the parameter `object` to pass a model. +#' If the corresponding argument is named differently in your `predict` function, specify its name. #' @param data `character` \cr #' The generic function \code{predict} uses a parameter \code{data} to pass new data. #' If the corresponding argument is named differently in your predict function, specify the name. #' @param extract_pred_fct `character or function` \cr -#' 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. -#' Default value is NULL, if predictions are rerturned as vector. +#' If the `predict` function called for the model does not return a vector, +#' use this argument to specify a function (or the name of a function) to extract +#' the vector of predictions. The default value is `NULL` if predictions are returned as a vector. #' @param extract_var_fct `character or function` \cr -#' If the variable selection function that is called 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 selected variables. +#' If the variable selection function does not return a vector, use this argument +#' to specify a function (or the name of a function) to extract the vector of selected variables. #' @param x_varsel `character` \cr #' If the name of the argument used by the provided original variable selection function to pass #' the matrix of independent variable is not \code{x}, use this argument to specify how it is called in the provided function. @@ -184,32 +194,40 @@ createTrainLayer = function (training, #' base models. #' #' @param training `Training` \cr -#' Training object where the created layer will be stored. +#' Training object for storing the created meta-layer. #' @param meta_layer_id `character` \cr #' ID of the layer to be created. #' @param lrner_package `character` \cr -#' Name of the package containing the function that implements the learning algorithm. -#' Default is `NULL`, if the function is available in the current working environment. +#' Package name containing the variable selection algorithm function. +#' Defaults to `NULL` if the function exists in the current working environment. #' @param lrn_fct `character` \cr -#' Name of the learning function. The corresponding function must allow at least two parameters `x` (of predictors) -#' and `y` (response values), and return a model. If not, the interface -#' parameters `x_lrn` and `y_lrn` below can be used to map these argument name with the original arguments in your function. -#' The returned model must allow the use of the generic function `predict` (with arguments `object` and `data`) to make -#' predictions for new data and predictions should be a vector or a `list` containing a vector called -#' `predictions` with the predicted values. See the details below about meta-learners. 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. +#' 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 param_train_list `character` \cr #' List of arguments to be passed to \code{lrn_fct}. #' @param param_pred_list `list` \cr #' List of arguments to be passed to \code{predict} when computing predictions. #' @param na_action `character`\cr -#' 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. +#' 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. #' @param x_lrn `character` \cr -#' If the name of the argument used by the provided original functions to pass -#' the matrix of independent variable is not \code{x}, use this argument to specify how it is called in the provided function. +#' 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. #' @param y_lrn `character` \cr -#' If the name of the argument used by the provided original functions to pass -#' the target variable is not \code{y}, use this argument to specify how it is called in the provided function. +#' 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. #' @param object `character` \cr #' The generic function \code{predict} uses a parameter \code{object} to pass a model. #' If the corresponding argument is named differently in your predict function, specify the name. @@ -219,7 +237,7 @@ createTrainLayer = function (training, #' @param extract_pred_fct `character or function` \cr #' 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. -#' Default value is NULL, if predictions are in a vector. +#' Defaults to NULL, if predictions are a vector. #' @details #' #' Internal meta-learners are available in the package. @@ -283,10 +301,10 @@ createTrainMetaLayer = function (training, #' @title varSelection #' @description -#' Variable selection on the current training object. +#' Variable selection on the training object passed as argument. #' #' @param training `Training` \cr -#' Training object where the created layer will be stored. +#' Training object for storing the created layer. #' @param ind_subset `vector` \cr #' ID subset of individuals to be used for variable selection. #' @@ -316,14 +334,16 @@ varSelection = function (training, #' object which can be used for predictions. #' #' @param training `Training` \cr -#' Training object where the created layer will be stored. +#' Training object for storing training layers. #' @param ind_subset `vector` \cr #' ID subset to be used for training. #' @param use_var_sel `boolean` \cr -#' If TRUE and no variable selection has been performed for the provide training object, then a variable selection will proceed the training. +#' If `TRUE` and no variable selection has been performed for the provide training object, +#' then a variable selection will proceed the training. #' Otherwise, if variable selection has been previously performed, the selected variables will be used for training. #' @param resampling_method `function` \cr -#' Function for internal validation. If not specify, the \code{resampling} function from the package \code{caret} is used for a 10-folds cross-validation. +#' Function for internal validation. If not specify, the \code{resampling} function +#' from the package \code{caret} is used for a 10-folds cross-validation. #' @param resampling_arg `list` \cr #' List of arguments to be passed to the function. #' @param seed `integer` \cr @@ -361,14 +381,14 @@ fusemlr = function (training, #' Computes predictions for the [Testing] object passed as argument. #' #' @param object `Training` \cr -#' Training object to be used to compute predictions. +#' A trained Training object to be used to compute predictions. #' @param testing `Testing` \cr #' A new testing object to be predicted. #' @param ind_subset `vector` \cr #' Vector of IDs to be predicted. #' #' @return -#' The predicted object. All layers and the meta layer are predicted. This is the final predicted object. +#' The final predicted object. All layers and the meta layer are predicted. #' @export #' @method predict Training predict.Training = function (object, @@ -411,7 +431,7 @@ extractData = function (object) { #' @title Training object Summaries #' @description -#' Summaries a fuseMLR [Training] object. +#' Summaries a `fuseMLR` [Training] object. #' #' @param object `Training` \cr #' The [Training] object of interest. diff --git a/doc/fuseMLR.html b/doc/fuseMLR.html index 2a96f94..5a4953b 100644 --- a/doc/fuseMLR.html +++ b/doc/fuseMLR.html @@ -471,7 +471,7 @@

C.1 - Creating a training

param_train_list = list(probability = TRUE, mtry = 1L), param_pred_list = list(), - na_action = "na.rm") + na_action = "na.keep") #> Training : training #> Problem type : classification #> Status : Not trained @@ -479,7 +479,7 @@

C.1 - Creating a training

#> Layers trained : 0 #> p : 131 #> n : 50 -#> na.action : na.rm +#> na.action : na.keep
# Create gene protein abundance layer
 createTrainLayer(training = training,
                  train_layer_id = "proteinexpr",
@@ -502,7 +502,7 @@ 

C.1 - Creating a training

#> Layers trained : 0 #> p : 131 | 160 #> n : 50 | 50 -#> na.action : na.rm | na.keep
+#> na.action : na.keep | na.keep
# Create methylation layer
 createTrainLayer(training = training,
                  train_layer_id = "methylation",
@@ -525,7 +525,7 @@ 

C.1 - Creating a training

#> Layers trained : 0 #> p : 131 | 160 | 367 #> n : 50 | 50 | 50 -#> na.action : na.rm | na.keep | na.keep
+#> na.action : na.keep | na.keep | na.keep

Also add a meta-layer. We use the weighted mean (internal function to fuseMLR) as meta-learner. Similarly to learners, a meta-learner should allow at least the arguments x and @@ -567,7 +567,7 @@

C.1 - Creating a training

#> Layers trained : 0 #> p : 131 | 160 | 367 #> n : 50 | 50 | 50 -#> na.action : na.rm | na.keep | na.keep +#> na.action : na.keep | na.keep | na.keep print(training) #> Training : training #> Problem type : classification @@ -576,7 +576,7 @@

C.1 - Creating a training

#> Layers trained : 0 #> p : 131 | 160 | 367 #> n : 50 | 50 | 50 -#> na.action : na.rm | na.keep | na.keep +#> na.action : na.keep | na.keep | na.keep

Function upsetplot() is available to generate an upset of the training data, i.e. an overview how patients overlap across layers.

@@ -664,7 +664,7 @@

C.2 - Variable selection

#> Layers trained : 0 #> p : 19 | 1 | 35 #> n : 50 | 50 | 50 -#> na.action : na.rm | na.keep | na.keep +#> na.action : na.keep | na.keep | na.keep

For each layer, the variable selection results show the chosen variables.

@@ -718,7 +718,7 @@

C.2 - Train

#> Var. sel. used : Yes #> p : 19 | 1 | 35 | 3 #> n : 50 | 50 | 50 | 26 -#> na.action : na.rm | na.keep | na.keep | na.rm +#> na.action : na.keep | na.keep | na.keep | na.rm

We can also display a summary of training to see more details on layer levels. Information about the training data modality, the variable selection method and the learner stored at each layer are @@ -734,7 +734,7 @@

C.2 - Train

#> Var. sel. used : Yes #> p : 19 | 1 | 35 | 3 #> n : 50 | 50 | 50 | 26 -#> na.action : na.rm | na.keep | na.keep | na.rm +#> na.action : na.keep | na.keep | na.keep | na.rm #> ---------------- #> #> Layer geneexpr diff --git a/man/createTestLayer.Rd b/man/createTestLayer.Rd index cb23751..e414d1f 100644 --- a/man/createTestLayer.Rd +++ b/man/createTestLayer.Rd @@ -20,5 +20,5 @@ Data modality to be stored in \link{TestData}.} The updated \link{Testing} object (with the new layer) is returned. } \description{ -Creates and store a \link{TestLayer} on the \link{Testing} object passed as argument. +Creates and stores a \link{TestLayer} on the \link{Testing} object passed as argument. } diff --git a/man/createTesting.Rd b/man/createTesting.Rd index 57c18d0..1a32641 100644 --- a/man/createTesting.Rd +++ b/man/createTesting.Rd @@ -11,10 +11,10 @@ createTesting(id, ind_col, verbose = TRUE) Testing id.} \item{ind_col}{\code{character} \cr -Name of column of individuals IDs in testing data.frame.} +Name of column of individuals IDs in testing \code{data.frame}.} \item{verbose}{\code{boolean} \cr -Warning messages will be displayed if set to TRUE.} +Warning messages will be displayed if set to \code{TRUE}.} } \value{ A \link{Testing} object. diff --git a/man/createTrainLayer.Rd b/man/createTrainLayer.Rd index 46e94e1..2b52dd0 100644 --- a/man/createTrainLayer.Rd +++ b/man/createTrainLayer.Rd @@ -28,51 +28,61 @@ createTrainLayer( } \arguments{ \item{training}{\code{Training} \cr -Training object where the created layer will be stored.} +Training object for storing the created layer.} \item{train_layer_id}{\code{character} \cr ID of the \link{TrainLayer} to be created.} \item{train_data}{\code{data.frame} \cr -Data modality to be stored in \link{TrainData}.} +Data modality to be stored on the layer.} \item{varsel_package}{\code{character} \cr -Name of the package containing the function that implements the variable selection algorithm.\cr} +Package name containing the variable selection algorithm function. +Defaults to \code{NULL} if the function exists in the current working environment.\cr} \item{varsel_fct}{\code{character} \cr -Name of variable selection function. Default value is \code{NULL} for no variable selection. -If specified, the function must allow at least two parameters \code{x} (of predictors) -and \code{y} (response values), and return a vector of selected variables. Otherwise use the interface parameters -\code{x_varsel}, \code{y_varsel} below to map the original argument names, and \code{extract_var_fct} indicate how to extract the vector of selected variables. -An exception, however, is made for the Boruta function, for which an internal adjustment is implemented; its use requires no further modifications.} +Variable selection function name. Default value is \code{NULL} for no variable selection. +If specified, the function must accept at least two parameters: \code{x} (predictors) +and \code{y} (response values), and return a vector of selected variables. +Alternatively, use the interface parameters \code{x_varsel} and \code{y_varsel} to map +the original argument names, and \code{extract_var_fct} to specify how to extract +the vector of selected variables. An exception is made for the \code{Boruta} function, +which includes an internal adjustment and requires no additional modifications.} \item{varsel_param}{\code{list} \cr List of arguments to be passed to \code{varsel_fct}.} \item{lrner_package}{\code{character} \cr -Name of the package containing the function that implements the learning algorithm. -Default is \code{NULL}, if the function is available in the current working environment.} +Name of the package containing the learning algorithm function. Defaults to +\code{NULL} if the function is available in the current working environment.} \item{lrn_fct}{\code{character} \cr -Name of the learning function. The corresponding function must allow at least two parameters \code{x} (of predictors) -and \code{y} (response values), and return a model. Otherwise, the interface -parameters \code{x_lrn} and \code{y_lrn} below can be used to map these argument name with the original arguments in your function. -The returned model must allow the use of the generic function \code{predict} (with arguments \code{object} and \code{data}) to make -predictions for new data and predictions should be a vector or a \code{list} containing a vector called -\code{predictions} with the predicted values. If the arguments \code{object} and \code{data} are named differently in your predict -function, use the interface parameters \code{object} and \code{data} below to specify the original names. In addition, if -predictions are stored as a \code{matrix} or a \code{data.frame} (e.g. predicted probabilities for different classes in dichotomous classification), -only the second column (assumed to be the class \code{1} probabilities) will be considered. If the predicted values are not returned in one of the formats above, -use the argument \code{extract_pred_fct} below to specify how the predicted values can be extracted from the predicted object.} +Name of the learning function. The function must accept at least two parameters: +\code{x} (predictors) and \code{y} (response values) and return a model. Alternatively, +use the interface parameters \code{x_lrn} and \code{y_lrn} to map these names to the +original arguments in your function. +The returned model must support the generic \code{predict} function (with arguments +\code{object} and \code{data}) to generate predictions for new data. Predictions should +be either a vector or a \code{list} containing a vector named \code{predictions} with +the predicted values.\cr +If the arguments \code{object} and \code{data} have different names in your \code{predict} +function, use the interface parameters below to map them to the original names. +Additionally, if predictions are stored as a \code{matrix} or \code{data.frame} +(e.g., predicted probabilities for dichotomous classification), only the second +column (assumed to be class \code{1} probabilities) will be used. +If the predicted values are not returned in one of the formats mentioned above, +use the \code{extract_pred_fct} argument below to specify how to extract the predicted +values from the prediction object.} \item{param_train_list}{\code{character} \cr List of arguments to be passed to \code{lrn_fct}.} \item{param_pred_list}{\code{character} \cr -List of arguments to be passed to \code{predict} when computing predictions.} +List of arguments to be passed to \code{predict} when generating predictions.} \item{na_action}{\code{character}\cr -Handling of missing values in data a modality during training. Set to "na.keep" to keep missing values, or "na.rm" to remove individuals with missing values. Imputation of missing values in data modalities is not yet handled.} +Handling of missing values in data during training. Set to \code{"na.keep"} to retain +missing values, or \code{"na.rm"} to remove instances with missing values.} \item{x_varsel}{\code{character} \cr If the name of the argument used by the provided original variable selection function to pass @@ -91,21 +101,21 @@ If the name of the argument used by the provided original learning function to p the target variable is not \code{y}, use this argument to specify how it is called in the provided function.} \item{object}{\code{character} \cr -The generic function \code{predict} uses a parameter \code{object} to pass a model. -If the corresponding argument is named differently in your predict function, specify the name.} +The generic function \code{predict} uses the parameter \code{object} to pass a model. +If the corresponding argument is named differently in your \code{predict} function, specify its name.} \item{data}{\code{character} \cr The generic function \code{predict} uses a parameter \code{data} to pass new data. If the corresponding argument is named differently in your predict function, specify the name.} \item{extract_pred_fct}{\verb{character or function} \cr -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. -Default value is NULL, if predictions are rerturned as vector.} +If the \code{predict} function called for the model does not return a vector, +use this argument to specify a function (or the name of a function) to extract +the vector of predictions. The default value is \code{NULL} if predictions are returned as a vector.} \item{extract_var_fct}{\verb{character or function} \cr -If the variable selection function that is called 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 selected variables.} +If the variable selection function does not return a vector, use this argument +to specify a function (or the name of a function) to extract the vector of selected variables.} } \value{ The updated \link{Training} object (with the new layer) is returned. diff --git a/man/createTrainMetaLayer.Rd b/man/createTrainMetaLayer.Rd index 9f7d855..906e8f0 100644 --- a/man/createTrainMetaLayer.Rd +++ b/man/createTrainMetaLayer.Rd @@ -21,23 +21,26 @@ createTrainMetaLayer( } \arguments{ \item{training}{\code{Training} \cr -Training object where the created layer will be stored.} +Training object for storing the created meta-layer.} \item{meta_layer_id}{\code{character} \cr ID of the layer to be created.} \item{lrner_package}{\code{character} \cr -Name of the package containing the function that implements the learning algorithm. -Default is \code{NULL}, if the function is available in the current working environment.} +Package name containing the variable selection algorithm function. +Defaults to \code{NULL} if the function exists in the current working environment.} \item{lrn_fct}{\code{character} \cr -Name of the learning function. The corresponding function must allow at least two parameters \code{x} (of predictors) -and \code{y} (response values), and return a model. If not, the interface -parameters \code{x_lrn} and \code{y_lrn} below can be used to map these argument name with the original arguments in your function. -The returned model must allow the use of the generic function \code{predict} (with arguments \code{object} and \code{data}) to make -predictions for new data and predictions should be a vector or a \code{list} containing a vector called -\code{predictions} with the predicted values. See the details below about meta-learners. If the arguments \code{object} and \code{data} are named differently in your predict -function, use the interface parameters \code{object} and \code{data} below to specify the original names.} +Name of the learning function. The function must accept at least two +parameters: \code{x} (predictors) and \code{y} (response values), and return a model. +If not, use the interface parameters \code{x_lrn} and \code{y_lrn} below to map these +argument names to the original arguments in your function. The returned model +must support the generic \code{predict} function (with arguments \code{object} and \code{data}) +to make predictions for new data, and the predictions should be a vector or +a \code{list} containing a vector called \code{predictions} with the predicted values. +If the arguments \code{object} and \code{data} are named differently in your predict +function, use the interface parameters \code{object} and \code{data} below to specify +the original names. See the details below about meta-learners.} \item{param_train_list}{\code{character} \cr List of arguments to be passed to \code{lrn_fct}.} @@ -46,15 +49,20 @@ List of arguments to be passed to \code{lrn_fct}.} List of arguments to be passed to \code{predict} when computing predictions.} \item{na_action}{\code{character}\cr -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.} +Handling of missing values in modality-specific predictions during training. +Set to \code{"na.keep"} to keep missing values, \code{"na.rm"} to remove individuals +with missing values or \code{"na.impute"} to impute missing values in modality-specific +predictions. Only median and mode based imputations are actually handled. +With the \code{"na.keep"} option, ensure that the provided meta-learner can handle missing values.} \item{x_lrn}{\code{character} \cr -If the name of the argument used by the provided original functions to pass -the matrix of independent variable is not \code{x}, use this argument to specify how it is called in the provided function.} +If the argument name used by the provided original function to pass the matrix +of independent variables is not \code{x}, use this argument to specify the name used +in the function.} \item{y_lrn}{\code{character} \cr -If the name of the argument used by the provided original functions to pass -the target variable is not \code{y}, use this argument to specify how it is called in the provided function.} +If the argument name used by the provided original function to pass the target +variable is not \code{y}, use this argument to specify the name used in the function.} \item{object}{\code{character} \cr The generic function \code{predict} uses a parameter \code{object} to pass a model. @@ -67,7 +75,7 @@ If the corresponding argument is named differently in your predict function, spe \item{extract_pred_fct}{\verb{character or function} \cr 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. -Default value is NULL, if predictions are in a vector.} +Defaults to NULL, if predictions are a vector.} } \value{ The updated \link{Training} object (with the new layer) is returned. diff --git a/man/fusemlr.Rd b/man/fusemlr.Rd index 87bc95e..87c4cb7 100644 --- a/man/fusemlr.Rd +++ b/man/fusemlr.Rd @@ -15,17 +15,19 @@ fusemlr( } \arguments{ \item{training}{\code{Training} \cr -Training object where the created layer will be stored.} +Training object for storing training layers.} \item{ind_subset}{\code{vector} \cr ID subset to be used for training.} \item{use_var_sel}{\code{boolean} \cr -If TRUE and no variable selection has been performed for the provide training object, then a variable selection will proceed the training. +If \code{TRUE} and no variable selection has been performed for the provide training object, +then a variable selection will proceed the training. Otherwise, if variable selection has been previously performed, the selected variables will be used for training.} \item{resampling_method}{\code{function} \cr -Function for internal validation. If not specify, the \code{resampling} function from the package \code{caret} is used for a 10-folds cross-validation.} +Function for internal validation. If not specify, the \code{resampling} function +from the package \code{caret} is used for a 10-folds cross-validation.} \item{resampling_arg}{\code{list} \cr List of arguments to be passed to the function.} diff --git a/man/predict.Training.Rd b/man/predict.Training.Rd index 9a4bf37..e1df049 100644 --- a/man/predict.Training.Rd +++ b/man/predict.Training.Rd @@ -8,7 +8,7 @@ } \arguments{ \item{object}{\code{Training} \cr -Training object to be used to compute predictions.} +A trained Training object to be used to compute predictions.} \item{testing}{\code{Testing} \cr A new testing object to be predicted.} @@ -17,7 +17,7 @@ A new testing object to be predicted.} Vector of IDs to be predicted.} } \value{ -The predicted object. All layers and the meta layer are predicted. This is the final predicted object. +The final predicted object. All layers and the meta layer are predicted. } \description{ Computes predictions for the \link{Testing} object passed as argument. diff --git a/man/summary.Testing.Rd b/man/summary.Testing.Rd index 278fbca..878f6f7 100644 --- a/man/summary.Testing.Rd +++ b/man/summary.Testing.Rd @@ -14,5 +14,5 @@ The \link{Testing} object of interest.} Further arguments.} } \description{ -Summaries a fuseMLR \link{Testing} object. +Summaries a \code{fuseMLR} \link{Testing} object. } diff --git a/man/summary.Training.Rd b/man/summary.Training.Rd index 0060a5e..5c41e42 100644 --- a/man/summary.Training.Rd +++ b/man/summary.Training.Rd @@ -14,5 +14,5 @@ The \link{Training} object of interest.} Further arguments.} } \description{ -Summaries a fuseMLR \link{Training} object. +Summaries a \code{fuseMLR} \link{Training} object. } diff --git a/man/varSelection.Rd b/man/varSelection.Rd index 6ef631a..24f369c 100644 --- a/man/varSelection.Rd +++ b/man/varSelection.Rd @@ -8,7 +8,7 @@ varSelection(training, ind_subset = NULL) } \arguments{ \item{training}{\code{Training} \cr -Training object where the created layer will be stored.} +Training object for storing the created layer.} \item{ind_subset}{\code{vector} \cr ID subset of individuals to be used for variable selection.} @@ -17,7 +17,7 @@ ID subset of individuals to be used for variable selection.} A \code{data.frame} with two columns: layer and selected variables. } \description{ -Variable selection on the current training object. +Variable selection on the training object passed as argument. } \references{ Fouodo C.J.K, Bleskina M. and Szymczak (2024). fuseMLR: An R package for integrative prediction modeling of multi-omics data, paper submitted. \cr diff --git a/vignettes/fuseMLR.Rmd b/vignettes/fuseMLR.Rmd index c24d1e1..ab058ad 100644 --- a/vignettes/fuseMLR.Rmd +++ b/vignettes/fuseMLR.Rmd @@ -86,7 +86,7 @@ createTrainLayer(training = training, param_train_list = list(probability = TRUE, mtry = 1L), param_pred_list = list(), - na_action = "na.rm") + na_action = "na.keep") ``` ```{r proteinexpr, include=TRUE, eval=TRUE}