powered by

Computes feasible sample sizes for the k groups in k-fold cv if N/k is not an integer.

kfoldcv(k, N, nlevel=NULL)

A vector of length k.

k

number of groups.

total sample size.

a vector of sample sizes for stratified sampling.

If N/k is not an integer, k-fold cv is not unique. Determine meaningful sample sizes.

# 10-fold CV with N = 91 kfoldcv(10, 91) # \testonly{ k <- sample(5:15, 1) k N <- sample(50:150, 1) N stopifnot(sum(kfoldcv(k, N)) == N) # }

Run the code above in your browser using DataLab