sampling {scorecardModelUtils} | R Documentation |
The function does random sampling of the data and split it into train and test datasets. Training base percentage and seed value(optional) is taken as arguments. If seed value is not specified, random seed will be generated on different iterations.
sampling(base, train_perc = 0.7, seed = NA, replace = F)
base |
input dataframe |
train_perc |
(optional) percentage of total base to be kept as training sample, to be provided as decimal/fraction (default percentage is 0.7) |
seed |
(optional) seed value (if not given random seed is generated) |
replace |
(optional) whether replacement will e with or without replacement (default is FALSE ie. without replacement) |
An object of class "sampling" is a list containing the following components:
train_sample |
training sample as a dataframe |
test_sample |
test sample as a dataframe |
seed |
seed used |
Arya Poddar <aryapoddar290990@gmail.com>
data <- iris
sampling_list <- sampling(base = data,train_perc = 0.7,seed = 1234)
sampling_list$train
sampling_list$test
sampling_list$seed