add_CVfolds_ind: Define a column of fold indicators for V-fold...

Description Usage Arguments Value

View source: R/utility_funs.R

Description

The input data is assumed to have repeated observations per subjects, the folds are defined as clustered by subject IDs.

Usage

1
add_CVfolds_ind(data, ID, nfolds = 5, fold_column = "fold", seed = NULL)

Arguments

data

Input dataset, can be a data.frame or a data.table.

ID

A character string name of the column that contains the unique subject identifiers.

nfolds

Number of unique folds (same fold is always assigned to all observations that share the same ID).

fold_column

A name of the column that will contain the fold indicators

seed

Random number seed for selecting a random fold.

Value

An input data with added fold indicator column (as ordered factor with levels 1:nfolds).


osofr/GriDiSL documentation built on May 24, 2019, 4:54 p.m.