check_groups: Check grouping vector

View source: R/checks.R

check_groupsR Documentation

Check grouping vector

Description

Check grouping vector

Usage

check_groups(dataset, groups, kfold)

Arguments

dataset

Data frame with an outcome variable and other columns as features.

groups

Vector of groups to keep together when splitting the data into train and test sets. If the number of groups in the training set is larger than kfold, the groups will also be kept together for cross-validation. Length matches the number of rows in the dataset (default: NULL).

kfold

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

Author(s)

Zena Lapp, zenalapp@umich.edu

Examples

## Not run: 
check_groups(mikropml::otu_mini_bin,
  sample(LETTERS, nrow(mikropml::otu_mini_bin), replace = TRUE),
  kfold = 2
)

## End(Not run)

SchlossLab/mikropml documentation built on Aug. 24, 2023, 9:51 p.m.