split_data {AutoScore}R Documentation

AutoScore function: Automatically splitting dataset to train, validation and test set

Description

AutoScore function: Automatically splitting dataset to train, validation and test set

Usage

split_data(data, ratio, cross_validation = FALSE)

Arguments

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 TRUE, cross-validation would be used for generating parsimony plot, which is suitable for small-size data. Default to FALSE

Value

Returns a list containing training, validation and testing set

Examples

data("sample_data")
set.seed(4)
#large sample size
out_split <- split_data(data = sample_data, ratio = c(0.7, 0.1, 0.2))
#small sample size (for cross-validation)
out_split <- split_data(data = sample_data, ratio = c(0.7, 0, 0.3), cross_validation = TRUE)

[Package AutoScore version 0.2.0 Index]