Description Usage Arguments Value Examples
View source: R/nmr_data_analysis.R
Random subsampling
1 2 3 4 5 6 7 | random_subsampling(
sample_idx,
iterations = 10L,
test_size = 0.25,
keep_together = NULL,
balance_in_train = NULL
)
|
sample_idx |
Typically a numeric vector with sample index to be separated. A character vector with sample IDs could also be used |
iterations |
An integer, the number of iterations in the random subsampling |
test_size |
A number between 0 and 1. The samples to be included in the test set on each interation. |
keep_together |
Either |
balance_in_train |
Either |
A list of length equal to iterations
. Each element of the list is
a list with two entries (training
and test
) containing the sample_idx
values that will belong to each subset.
1 2 3 4 | random_subsampling(1:100, iterations = 4, test_size = 0.25)
subject_id <- c("Alice", "Bob", "Charlie", "Eve")
random_subsampling(1:4, iterations = 2, test_size = 0.25, keep_together = subject_id)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.