Description Usage Arguments Value
This function is used to estimate the optimal number of dimensions to retain when normalizing with BARA. The optimization is performed using an external test set, ideally affected by batch effects.
1 2 3 4 5 6 | bara_optimize_ext(x_train, ref_train, y_train, x_test, ref_test, y_test,
fit_fun, pred_fun, perf_fun = NULL, batch_test = NULL,
perf_objective = c("maximize", "minimize"), max_dim = 100,
frac_rm = 0.05, fit_args = NULL, pred_args = NULL,
perf_args = NULL, scale_var = FALSE, verbose = TRUE, cores = 1,
.export = NULL, .packages = NULL, seed = 16438)
|
x_train |
Matrix, training data set. Samples in rows. |
ref_train |
Numeric vector, index of reference samples in the training set. |
y_train |
Response variables corresponding to the training set. |
x_test |
Matrix, test data set. Samples in rows. |
ref_test |
Numeric vector, index of reference samples in the test set. |
y_test |
Response variable corresponding to the test set. |
fit_fun |
Function, fits a prediction object from the training data. The function must take the following arguments:
|
pred_fun |
Function, classifies the samples in the test set and returns the predictions. The function must have the following parameters:
|
perf_fun |
Function, estimates the performance of the generated predictions. The performance should be returned as a numeric value. This parameter can also be left to the default value of NULL if no performance scores should be calculated. If a function is passed. it must have the the following parameters:
|
batch_test |
Character/numeric/factor, describing the batch belongings of the test set. |
perf_objective |
Character, either |
max_dim |
Numeric, determines the maximum number of dimensions
to retain. This parameter can be decreased to reduce computational
time. Default value is |
frac_rm |
Numeric between 0 and 1. How large fraction of the dimensions
should be dropped in each iteration. For example, if
|
fit_args |
List with arguments passed to |
pred_args |
List with arguments passed to |
perf_args |
List with arguments passed to |
scale_var |
Logical, should the variances be standardized.
The default value is |
verbose |
Logical, should runtime messages be displayed? Default
value is |
cores |
Integer, number of cores to use for computations. |
.export |
Variables that any of |
.packages |
Packages that any of |
seed |
Integer, seed for reproducible computations. |
An object of class BaraOpt containing:
fit
: A BaraFit object with the optimal dimensions retained.
best_dim
Numeric, the number of dimensions retained for the
optimal prediction performance.
iterations
: List, results from the iterative process,
including predictions and prediciton models for the number of
dimensions examined.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.