cvtype | R Documentation |
This function generates test dataset index for cross-validation.
cvtype(n, cv.bsize=1, cv.kfold, cv.random=TRUE)
n |
the number of observation |
cv.bsize |
block size of cross-validation |
cv.kfold |
the number of fold of cross-validation |
cv.random |
whether or not random cross-validation scheme should be used. Set cv.random=TRUE for random cross-validation scheme |
This function provides index of test dataset according to various cross-validation scheme.
One may construct K test datasets in a way that each testset consists of blocks of b
consecutive data. Set cv.bsize = b
for this.
To select each fold at random, set cv.random = TRUE
.
matrix of which row is test dataset index for cross-validation.
cvwavelet
,
cvimpute.by.wavelet
,
cvwavelet.after.impute
.
# Traditional 4-fold cross-validation for 100 observations cvtype(n=100, cv.bsize=1, cv.kfold=4, cv.random=FALSE) # Random 4-fold cross-validation with block size 2 for 100 observations cvtype(n=100, cv.bsize=2, cv.kfold=4, cv.random=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.