stratified_split {structToolbox} | R Documentation |
Splits the data into a training and test set, using stratification to keep group sizes in equal proportions to the full dataset.
stratified_split(p_train, factor_name, ...)
p_train |
The proportion of samples in the training set. |
factor_name |
The column of sample_meta to use for stratification |
... |
additional slots and values passed to struct_class |
struct object
D = iris_DatasetExperiment() M = stratified_split(p_train=0.75,factor_name='Species') M = model_apply(M,D)