train_test_split: A function for splitting data into a train/test set

View source: R/train-test-split.R

train_test_splitR Documentation

A function for splitting data into a train/test set

Description

This function splits data into a training and testing set. You can choose the test size. It returns a list with the training data and test data as separate objects.

Usage

train_test_split(data, test_size = 0.2)

Arguments

data

a data.frame or matrix where rows equal observations. Location of xs and ys does not matter.

test_size

a real value in (0,1). Default is 0.2. If less than 0 or greater than 1 an error is returned.

Examples

df <- create.regr.data(100,4,ytype="continuous")$Data
train_test_slit(df)

snelson89/extendedglmnetGroup7 documentation built on May 12, 2022, 7:38 p.m.