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 
#> 15 10 10  9 10  9 10  9  8 10 
table(y[,3],fold)
#>    fold
#>     1 2 3 4 5 6 7 8 9 10
#>   0 8 7 5 5 5 5 5 5 5  5
#>   1 7 3 5 4 5 4 5 4 3  5