crossvalidation | R Documentation |
Cross validation utility functions.
sample.for.cv (dat, v, seed)
get.kfold.splits (dat, k, seed)
kfold.split (k, n1, n0)
ran.kfold.split(k, n1, n0, replicates)
lpo.split(n1, n0)
get.splits (dat, cv.scheme=c("LPO","5fold","50xrandom4:1"), seed)
dat |
a data frame. One of the columns must be named y and y should be 0/1 with 1 for case and 0 for control |
v |
v-fold cross validation |
seed |
seed for random number generators |
k |
var.equal |
n1 |
var.equal |
n0 |
var.equal |
replicates |
var.equal |
cv.scheme |
var.equal |
sample.for.cv: case and controls are sampled separately.
sample.for.cv returns a list of two vector of integers: train and test, which refer to the rows of dat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.