sample_random: Split the Training and Test Set

Description Usage Arguments Value

View source: R/1-sample_random.R

Description

This function splits a list of inputs and a list of outputs by random sampling. All inputs and outputs get split the same.

Usage

1
sample_random(x, y, split = 67, scale = FALSE, normalize = FALSE)

Arguments

x

The input data or a list of input data.

y

The output data or a list of output data.

split

An integer. The training-test set split as a percentage.

scale

A logical. Toggles whether to scale each sample by the total sum, turning the measurements into proportions.

normalize

A logical. Toggles whether to normalize each feature by subtracting the training set minimum and dividing by the training set range.

Value

A nested list with two slots "train" and "test", each of which contain another list with two more slots "x" and "y". These provide a list of the processed inputs and outputs, respectively. For example, access the training input with $train$x. You can feed these lists to build.


tpq/caress documentation built on March 11, 2021, 8:03 p.m.