Skip to contents

Folds for multi-task learning

Usage

make.folds.multi(y, family, nfolds = 10)

Arguments

y

matrix with n rows (samples) and q columns (outcomes)

family

character "gaussian" or "binomial"

nfolds

integer between 2 and n

Examples

family <- "binomial"
y <- sim.data.multiple(family=family)$y_train
fold <- make.folds.multi(y=y,family=family)
table(fold)
#> fold
#>  1  2  3  4  5  6  7  8  9 10 
#> 14 11 11 11 10  9  8  8  9  9 
table(y[,3],fold)
#>    fold
#>     1 2 3 4 5 6 7 8 9 10
#>   0 7 6 6 6 5 5 4 5 5  5
#>   1 7 5 5 5 5 4 4 3 4  4