holdout: holdout

View source: R/holdout.R

holdoutR Documentation

holdout

Description

this function is used to holdout input data from being trained on the model

Usage

holdout(
  file_path = file_path,
  seed = seed,
  groups = groups,
  holdout_fraction = holdout_fraction
)

Arguments

file_path

path to the input dataframe

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)

holdout_fraction

fraction of data that will be heldout for training the model

Examples

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
holdout_fraction <- 0.8
data <- simulate_data(number_of_participants,covariance_matrix,outcome_column,means)
randomized_data <- randomize(data=data,seed=seed)
stratified_data <- stratify_data(randomized_data=randomized_data, groups=groups)
train_and_test <- split_data(stratified_data=stratified_data, holdout_fraction=holdout_fraction)

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