CVfolds: Creates (repeated) cross-validation folds

Description Usage Arguments Details Value See Also Examples

View source: R/MultiLambdaCVfun.R

Description

Creates (repeated) cross-validation folds for samples

Usage

1
CVfolds(Y, model = NULL, balance = TRUE, kfold = 10, fixedfolds = TRUE, nrepeat = 1)

Arguments

Y

Response vector: numeric, binary, factor or survival.

model

Character. Any of c("linear", "logistic", "cox"). Is inferred from Y when NULL.

balance

Boolean. Should the splits be balanced in terms of response labels?

kfold

Integer. Desired fold.

fixedfolds

Boolean. Should fixed splits be used for reproducibility?

nrepeat

Numeric. Number of repeats.

Details

Creates (repeated), possibly balanced, splits of the samples. Computing time will often largely depend on on kfold*nrepeat, the number of training-test splits evaluated.

Value

List object with kfold*nrepeat elements containing the sample indices of the left-out samples per split.

See Also

A full demo and data are available from:
https://drive.google.com/open?id=1NUfeOtN8-KZ8A2HZzveG506nBwgW64e4

Examples

1
2
3
data(dataXXmirmeth)
resp <- dataXXmirmeth[[1]]
leftout <- CVfolds(Y=resp,kfold=10,nrepeat=3,fixedfolds = TRUE)

multiridge documentation built on June 15, 2021, 9:08 a.m.