Description Usage Arguments Value Author(s) Examples
A function to split a dataset into training and testing sets for cross validation.
1 | slb.xval.split(X, Y, k = "loo", reverse = FALSE, ...)
|
X |
|
Y |
|
k |
the cross-validated method to perform. Defaults to
|
reverse |
whether to flip the training and testing partitions. Defaults to
|
... |
optional args. |
sets the cross-validation sets as an object of class "XV"
containing the following:
|
is |
|
is |
Eric Bridgeford
1 2 3 4 5 6 7 8 9 10 | # prepare data for 10-fold validation
library(slb)
data(SWD)
sets.xval.10fold <- slb.xval.split(SWD$X, SWD$Y, k=10)
# prepare data for loo validation
sets.xval.loo <- slb.xval.split(SWD$X, SWD$Y, k='loo')
# reverse the training and testing sets
sets.xval.10fold.rev <- slb.xval.split(SWD$X, SWD$Y, k=10, reverse=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.