split_data: split_data

View source: R/split_data.R

split_dataR Documentation

split_data

Description

this function provides a split dataset to be used by the cross_validation function.

Usage

split_data(stratified_data, holdout_fraction, nfolds)

Arguments

stratified_data

dataframe of the stratified data returned by the stratify_by function

holdout_fraction

fraction of data that will be heldout for training the model, if using split_data for holdout

nfolds

number of folds in the data if using split_data for cross validation

Examples

simulate_data(number_of_participants=10, covariance_matrix=diag(2), outcome_column=1, means=c(0,0))
randomized_data <- randomize(data=data, seed = 7)
stratified_data <- stratify_data(randomized_data=randomized_data,groups=groups)
train_and_test <- split_data(stratified_data=stratified_data,holdout_fraction=0.8)
folded_data <- split_data(stratified_data=train_and_test$training_dataset,nfolds=5)

DCAN-Labs/RFRF documentation built on March 15, 2024, 2:33 p.m.