slices: Create Time Slice Samples

Description Usage Arguments Value Examples

View source: R/sampling.R

Description

Function to create time slice indices. Based on createTimeSlices from Caret package

Usage

1
2
slices(df, width, horizon, skip = 0, fixed_width = TRUE,
  label = "slice")

Arguments

df

data.frame to sample from

width

number of records per training sample

horizon

number of recoreds per validation sample

skip

number of samples skipped. default is 0

fixed_width

logical option to keep all training samples the same width. default is TRUE

label

string label for samples. default is 'slice'

Value

list with train and validation samples

Examples

1
2
3
library(tibble)
df <- tibble(i = 1:20)
slices(df, width = 15, horizon = 1, skip = 0)

chrishaarstick/mad4sight documentation built on May 6, 2019, 4:31 p.m.