testsplit: Split data set into training and validation sets, stratifying...

Description Usage Arguments Value

Description

Split data set into training and validation sets, stratifying by groups. Of each class of n items, floor(fraction*n) go to training set and ceiling((1-fraction)*n) go to validation set.

Usage

1
2
testsplit(data, fraction = 0.5, size = NULL, replace = FALSE,
  stratify = "Class")

Arguments

data

The data matrix

fraction

The fraction of data to place in the training and testing set.

size

The amount of data to place in the training and testing set

replace

Should the splitting be with replacement. Default is FALSE.

stratify

Variable according to which stratification should be performed.

Value

Indices of the training set.


bwrc/astrid-r documentation built on May 13, 2019, 9:08 a.m.