kfold_cross_validation | R Documentation |
Construct a cross-validation specification that randomly partitions the input set into nfolds
folds.
kfold_cross_validation(len, nfolds = 10)
len |
An integer representing the number of observations. |
nfolds |
An integer specifying the number of cross-validation folds. |
This function creates a k-fold cross-validation scheme for cases where data needs to be split into a specified number of folds for evaluation. It returns an object of class "kfold_cross_validation", "cross_validation", and "list".
An object of class "kfold_cross_validation", "cross_validation", and "list" containing the block_var and nfolds.
cval <- kfold_cross_validation(len=100, nfolds=10)
samples <- crossval_samples(cval, data=as.data.frame(matrix(rnorm(100*10), 100, 10)), y=rep(letters[1:5],20))
stopifnot(nrow(samples) == 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.