Description Usage Arguments Details Value Examples
View source: R/create_data_split.r
This function prepares the cross-validation by splitting the
data into num.folds
training and test folds for
num.resample
times.
1 2 | create.data.split(siamcat, num.folds = 2, num.resample = 1,
stratify = TRUE,inseparable = NULL, verbose = 1)
|
siamcat |
object of class siamcat-class |
num.folds |
number of cross-validation folds (needs to be |
num.resample |
resampling rounds (values |
stratify |
boolean, should the splits be stratified so that an equal
proportion of classes are present in each fold?, defaults to |
inseparable |
column name of metadata variable, defaults to |
verbose |
control output: |
This function splits the labels within a siamcat-class object and prepares the internal cross-validation for the model training (see train.model).
The function saves the training and test instances for the different
cross-validation folds within a list in the data_split
-slot of the
siamcat-class object, which is a list with four entries:
num.folds
the number of cross-validation folds
num.resample
the number of repetitions for the
cross-validation
training.folds
a list containing the indices for the
training instances
test.folds
a list containing the indices for the
test instances
object of class siamcat-class with the data_split
-slot
filled
1 2 3 4 5 6 7 8 | data(siamcat_example)
# simple working example
siamcat_split <- create.data.split(siamcat_example, num.folds=10,
num.resample=5, stratify=TRUE)
## # example with a variable which is to be inseparable
## siamcat_split <- create.data.split(siamcat_example, num.folds=10,
## num.resample=5, stratify=FALSE, inseparable='Gender')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.