Check grouping vector

check_group(dataset, group, kfold)

Arguments

dataset

Dataframe with an outcome variable and other columns as features.

group

Vector of groups to keep together when splitting the data into train and test sets, and for cross-validation; length matches the number of rows in the dataset (default: no groups).

kfold

Fold number for k-fold cross-validation (default: 5).

Examples

check_group(mikropml::otu_mini, sample(LETTERS, nrow(mikropml::otu_mini), replace = TRUE), kfold = 2 )