powered by
Split a dataset
split_df(dt, y = NULL, ratio = 0.7, seed = 186)
A data frame.
Name of y variable, defaults NULL. The dataset dt will split based on the predictor y, if it is specified.
A numeric value, defaults 0.7. It indicates the ratio of total rows contained in one split, must less than 1.
A random seed, defaults 186. The specify seed is used for random sorting data.
# NOT RUN { library(scorecard) data(germancredit) dts = split_df(germancredit, y="creditability") train = dts$train test = dts$test # }
Run the code above in your browser using DataLab