View source: R/stratified_split_class.R
stratified_split | R Documentation |
The dataset is divided into two subsets. A predefined proportion of samples from each level of a factor is selected for the training set, and the remaining samples are used for the test set. The stratification by factor level means that the relative number of samples per level is approximately equal to the original dataset.
stratified_split(p_train, factor_name, ...)
p_train |
(numeric) The proportion of samples selected for the training set. |
factor_name |
(character) The name of a sample-meta column to use. |
... |
Additional slots and values passed to |
A stratified_split
object with the following output
slots:
training | (DatasetExperiment) A DatasetExperiment object containing samples selected for the training set. |
testing | (DatasetExperiment) A DatasetExperiment object containing samples selected for the testing set. |
A stratified_split
object inherits the following struct
classes:
[stratified_split]
>> [split_data]
>> [model]
>> [struct_class]
M = stratified_split(
factor_name = "V1",
p_train = 0.75)
D = iris_DatasetExperiment()
M = stratified_split(p_train=0.75,factor_name='Species')
M = model_apply(M,D)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.