split_data | R Documentation |
AutoScore Function: Automatically splitting dataset to train, validation and test set, possibly stratified by label
split_data(data, ratio, cross_validation = FALSE, strat_by_label = FALSE)
data |
The dataset to be split |
ratio |
The ratio for dividing dataset into training, validation and testing set. (Default: c(0.7, 0.1, 0.2)) |
cross_validation |
If set to |
strat_by_label |
If set to |
Returns a list containing training, validation and testing set
data("sample_data") names(sample_data)[names(sample_data) == "Mortality_inpatient"] <- "label" set.seed(4) #large sample size out_split <- split_data(data = sample_data, ratio = c(0.7, 0.1, 0.2)) #small sample size out_split <- split_data(data = sample_data, ratio = c(0.7, 0, 0.3), cross_validation = TRUE) #large sample size, stratified out_split <- split_data(data = sample_data, ratio = c(0.7, 0.1, 0.2), strat_by_label = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.