stratified_split {structToolbox} | R Documentation

## Stratified sampling

### Description

Splits the data into a training and test set, using stratification to keep group sizes in equal proportions to the full dataset.

### Usage

    stratified_split(p_train, factor_name, ...)

### Arguments

`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

### Value

struct object

### Examples

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

[Package structToolbox version 0.99.8 Index]