create_folds_mc | R Documentation |
Function takes input vector of variables which will be used to group input objects. It creates folds with approaximately equal number of objects in each fold. All object of the same group put in the single fold.
create_folds_mc(
v,
nfolds = "auto",
max_iter = 1000,
start_opt_param = 100,
error_limit = NA,
seed = 0
)
v |
input vector of group variables. |
nfolds |
maximum number of folds. But if it is not possible to create the specified number of folds its number will be automatically decreased. |
max_iter |
maximum number of Monte Carlo iterations. |
start_opt_param |
strting parameter of Monter Carlo optimization. |
error_limit |
if final error will be greater than this values results will be discarded. |
seed |
seed for random number generator to reproduce results. |
vector of folds numbers for each input object.
df <- data.frame(A=runif(100), B=runif(100), C=sample(LETTERS[1:10], 100, TRUE))
res <- create_folds_mc(df$C, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.