Description Usage Arguments Value Examples
View source: R/createCvTrainTestSets.R
Shuffles observations and splits them into k-fold train/test sets.
1 2 3 4 5 6 7 | createCvTrainTestSets(
df,
k = 10,
stratify.by.col = NULL,
return.data = T,
show.warnings = T
)
|
df |
A dataframe of observations as rows and features as columns |
k |
Number of folds to split the data into |
stratify.by.col |
(Optional) The name of a column containing the response classes by which to stratify the data. Stratification ensures that all classes are present in every train/test set. |
return.data |
Return the split dataframe or only indexes |
show.warnings |
Show warnings? |
A list of length(k), containing a sublist of train and test data or indexes
1 | createCvTrainTestSets(df, k=10, stratify.by.col = 'response')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.