test_train_split: Split dataset into train and test

Description Usage Arguments Value See Also Examples

View source: R/EZ.R

Description

Splitting dataset into training and testing is a job done before every moedel training So this function does exactly that

Usage

1
test_train_split(data, train_size = 0.8, seed = 1, shuffle = FALSE)

Arguments

data

Dataframes,Arrays,Vectors

train_size

Numeric (should be between 0.0 and 1.0). Represent the proportion of the dataset to include in the test split.

seed

Controls the shuffling applied to the data before applying the split. Pass an int for reproducible output across multiple function calls.

shuffle

Whether or not to shuffle the data before splitting. Default is set to FALSE

Value

List containing train-test split of inputs.

See Also

base::gsub() which this function wraps.

Examples

1
2
test_train_split(mtcars)
test_train_split(mtcars, train_size=0.75, seed=101, shuffle=TRUE)

light2802/EZ documentation built on Dec. 21, 2021, 10:47 a.m.