View source: R/createFolds.SPQR.R
createFolds.SPQR | R Documentation |
Helper function to generate cross-validation folds that can be used by cv.SPQR
.
createFolds.SPQR(Y, nfold, stratified = FALSE)
Y |
The response vector. |
nfold |
The number of cross-validation folds. |
stratified |
If |
A list of size nfold
containing indices of the observations for each fold.
set.seed(919) n <- 1000 X <- rbinom(n, 1, 0.5) Y <- rnorm(n, X, 0.8) folds <- createFolds.SPQR(Y, nfold = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.