View source: R/deepTimeSeries.r
partition | R Documentation |
Subset data set/time series into several slices
partition(
dataset,
column = NULL,
between = NULL,
proportion = 0.7,
shuffle = FALSE
)
dataset |
A data set or time series, usually a data frame. |
column |
The name or index of a periodic column. |
between |
A list of usually value pairs which are used as lower and upper boundaries for the slices of |
proportion |
A proportion value, default |
shuffle |
A logical value indicating whether the rows of the subsets should be shuffled, default |
If no column and between values are specified a typically split into two slices is done.
Subsets of dataset
usually for training and test purposes for Machine and Deep Learning tasks.
Other Time Series:
diff_log()
,
diff_percentage()
,
diffinv_log()
,
diffinv_percentage()
,
diffinv_simple()
,
get_season()
,
invert_differencing()
,
lags()
,
period()
,
stationary()
df <- data.frame(date = as.Date(c("01.01.2021", "02.01.2021", "03.01.2021", "04.01.2021", "05.01.2021", "06.01.2021", "07.01.2021", "08.01.2021", "09.01.2021", "10.01.2021", "11.01.2021", "12.01.2021", "13.01.2021", "14.01.2021"), format = "%d.%m.%Y"),
value = sample(100, 14L))
library(keras)
c(train, test) %<-% partition(df, shuffle = T)
c(train, test1, test2, test3) %<-%
partition(df, column = "date",
between = list(c(from = "2021-01-01", to = "2021-01-06"),
c(from = "2021-01-07", to = "2021-01-10"),
c(from = "2021-01-08", to = "2021-01-11"),
c(from = "2021-01-01")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.