View source: R/cross_validation.R
cross_validation | R Documentation |
this function is used to create folds of the training data for training the model
cross_validation(
training_dataset = training_dataset,
seed = seed,
groups = groups,
nfolds = nfolds
)
training_dataset |
the training data |
seed |
initialize a random number generator with a specific seed value |
groups |
information on how the stratified data will be grouped (name of column, index of column, vector) |
nfolds |
number of folds in the data if using split_data for cross validation |
number_of_participants <- 10
covariance_matrix <- diag(2)
outcome_column <- 1
means <- c(0,0)
seed <- set.seed(7)
groups <- rep(1:2, each = 5) #information on how the stratified data will be grouped
nfolds <- 5
data <- simulate_data(number_of_participants,covariance_matrix,outcome_column,means)
randomized_data <- randomize(training_dataset=data,seed=seed)
stratified_data <- stratify_data(randomized_data=randomized_data, groups=groups)
folded_data <- split_data(stratified_data=stratified_data, nfolds=nfolds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.