Description Usage Arguments Value Examples
View source: R/data_process_tools.R
train_test_split
Functions for partition of data.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
dat |
A data.frame with independent variables and target variable. |
prop |
The percentage of train data samples after the partition. |
split_type |
Methods for partition.
|
occur_time |
The name of the variable that represents the time at which each observation takes place. It is used for "OOT" split. |
cut_date |
Time points for spliting data sets, e.g. : spliting Actual and Expected data sets. |
start_date |
The earliest occurrence time of observations. |
save_data |
Logical, save results in locally specified folder. Default is FALSE. |
dir_path |
The path for periodically saved data file. Default is "./data". |
file_name |
The name for periodically saved data file. Default is "dat". |
note |
Logical. Outputs info. Default is TRUE. |
seed |
Random number seed. Default is 46. |
A list of indices (train-test)
1 2 3 4 5 | train_test = train_test_split(lendingclub,
split_type = "OOT", prop = 0.7,
occur_time = "issue_d", seed = 12, save_data = FALSE)
dat_train = train_test$train
dat_test = train_test$test
|
Package 'creditmodel' version 1.2.7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.