stratified_split: Stratified sampling

Description Usage Arguments Value Examples

View source: R/stratified_split_class.R

Description

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.

Usage

1
stratified_split(p_train, factor_name, ...)

Arguments

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 struct_class.

Value

A stratified_split object.

Examples

1
2
3
D = iris_DatasetExperiment()
M = stratified_split(p_train=0.75,factor_name='Species')
M = model_apply(M,D)

structToolbox documentation built on Nov. 8, 2020, 6:54 p.m.