train_test_split: Train-test split by person, so that no person shows up in...

View source: R/data_prep.R

train_test_splitR Documentation

Train-test split by person, so that no person shows up in both the training and test set. Note that test_size refers to the number/percentage of _people_, not of _rows_.

Description

Train-test split by person, so that no person shows up in both the training and test set. Note that test_size refers to the number/percentage of _people_, not of _rows_.

Usage

train_test_split(df, test_size, combine = FALSE)

Arguments

df

(data.frame) NEBCS data

test_size

(number) Float between 0 and 1 indicating a percentage of the data to use as the test set, or integer indicating the number of rows to use as the test set.

combine

(bool) (default=FALSE) Whether or not to combine the training and test sets with test set marked as 'validation == 1'.

Value

(list<data.frame>) Training set, test set, optionally combined set.

Examples

tts_df_list = get_case_cntl(df)
tts_df_list$train
tts_df_list$test

paulsavala/nebcs documentation built on March 20, 2022, 9:24 a.m.