train_test_subset: Get training and testing subsets of data

Description Usage Arguments Value Author(s) See Also Examples

View source: R/subset.r

Description

Function subsets data into training and testing datasets.

Usage

1
train_test_subset(data, train_perc = 0.8, test_len = NULL)

Arguments

data

A numeric vector, time series, data.frame or matrix containg data to be subsetted.

train_perc

Percentage of data observations to compose the training dataset. Ignored if test_len is given.

test_len

Required length of testing dataset. If NULL, 1-train_perc is used for computing the number of data observations in the testing dataset.

Value

A list with train and test subsets of data.

Author(s)

Rebecca Pontes Salles

See Also

Other transformation methods: Diff(), LogT(), WaveletT(), emd(), mas(), mlm_io(), outliers_bp(), pct()

Examples

1
2
3
4
5
data(CATS)
d <- train_test_subset(CATS[,1])

swin <- sw(CATS[,1],5)
d_sw <- train_test_subset(swin)

TSPred documentation built on Jan. 21, 2021, 5:10 p.m.