Search code examples
rcross-validation

splitTools/create_folds setting random seed and repetition


If I set m_rep to 5 with 10 fold cross validation for create_folds function from splitTools and set seed to a number. Does this mean all the repetitions will have the same train and test sets?

create_folds(data[[targetVariable]], k = 10, m_rep = 5, type = "stratified", shuffle = TRUE, seed = 42)

Solution

  • First the random number generator is initialized, then the (multiple) folds are being generated. The answer to your question is thus "no", which I guess makes sense.