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