Create method for NMR data analysis
Usage
new_nmr_data_analysis_method(
train_evaluate_model,
train_evaluate_model_params_inner,
choose_best_inner,
train_evaluate_model_params_outer,
train_evaluate_model_digest_outer
)
Arguments
- train_evaluate_model
A function. The
train_evaluate_model
must have the following signature:The
x_train
andy_train
(and their test counterparts) are self-explanatory.The
identity_
arguments are expected to be factors. They can be used for instance with a callback that uses mixOmics::plsda in amultilevel
approach for longitudinal studies. In those studies theidentity
would be an identifier of the subject.The
...
arguments are free to be defined for eachtrain_evaluate_model
.- train_evaluate_model_params_inner, train_evaluate_model_params_outer
A list with additional arguments to pass to
train_evaluate_model
either in the inner cv loop or in the outer cv loop.- choose_best_inner
A function with a single argument:
The argument is a list of
train_evaluate_model
outputs. The return value of must be a list with at least an element namedtrain_evaluate_model_args
.train_evaluate_model_args
must be a named list.Each element must be named as one of the
train_evaluate_model
arguments.Each element must be a vector as long as the number of outer cross-validations.
The values of each vector must be the values that the
train_evaluate_model
argument must take on each outer cross-validation iteration Additional list elements can be returned and will be given back to the user
- train_evaluate_model_digest_outer
A function with a single argument:
function(outer_cv_results)
The argument is a list of
train_evaluate_model
outputs in outer cross-validation. The return value is returned bynmr_data_analysis
Value
An object encapsulating the method dependent functions that can be used with nmr_data_analysis