View source: R/kfold_xval_class.R
kfold_xval | R Documentation |
k-fold cross-validation is an iterative approach applied to validate models. The samples are divided into k "folds", or subsets. Each subset is excluded from model training and used for model validation once, resulting in a single left-out prediction for each sample. Model performance metrics are then computed for the training and test sets across all folds.
kfold_xval(folds = 10, method = "venetian", factor_name, collect = NULL, ...)
folds |
(numeric, integer) The number of cross-validation folds. The default is |
method |
(character) Fold selection method. Allowed values are limited to the following:
The default is |
factor_name |
(character) The name of a sample-meta column to use. |
collect |
(NULL, character) The name of a model output to collect over all bootstrap repetitions, in addition to the input metric. The default is |
... |
Additional slots and values passed to |
A kfold_xval
object with the following output
slots:
results | (data.frame) |
metric | (data.frame) |
metric.train | (numeric) |
metric.test | (numeric) |
collected | (list) |
A kfold_xval
object inherits the following struct
classes:
[kfold_xval]
>> [resampler]
>> [iterator]
>> [struct_class]
M = kfold_xval(
folds = 5,
method = "random",
factor_name = "V1",
collect = NULL)
D = iris_DatasetExperiment()
I = kfold_xval(factor_name='Species') *
(mean_centre() + PLSDA(factor_name='Species'))
I = run(I,D,balanced_accuracy())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.