dfSplit: Split a data frame into multiple parts.

Description Usage Arguments Value

Description

Given a data frame, split it as either (1) K equal slices for use in K-fold cross validation or (2) into a train-test split. If split into a training and testing set, you may select the training size as either a fraction of the original data, or by the number of observations.

Usage

1
2
dfSplit(dat, method = c("kfold", "traintest"), K = NULL,
  train_frac = NULL, train_n = NULL)

Arguments

dat

Either a data frame or matrix to be split.

method

Either "kfold" or "traintest", for splitting based on K-fold cross validation or a train/test split.

K

The number of folds, if "kfold" is selected.

train_frac

The fraction of data to be put into the training set.

train_n

The number of observations to be put into the trianing set, if train_frac is not selected.

Value

A list of data frames sliced from the original data.


TimothyKBook/rutilstb documentation built on May 9, 2019, 4:48 p.m.