View source: R/as-ts-dataloder.R
as_ts_dataloader | R Documentation |
Quick shortcut to create a torch dataloader based on the given dataset
as_ts_dataloader( data, formula, index = NULL, key = NULL, predictors = NULL, outcomes = NULL, categorical = NULL, timesteps, horizon = 1, sample_frac = 1, batch_size, shuffle = FALSE, jump = 1, drop_last = TRUE, ... )
data |
( |
formula |
( |
index |
( |
key |
( |
predictors |
( |
outcomes |
( |
categorical |
( |
timesteps |
( |
horizon |
( |
sample_frac |
( |
batch_size |
( |
shuffle |
( |
drop_last |
( |
library(rsample) library(dplyr, warn.conflicts = FALSE) suwalki_temp <- weather_pl %>% filter(station == "SWK") %>% select(date, temp = tmax_daily) # Splitting on training and test data_split <- initial_time_split(suwalki_temp) train_dl <- training(data_split) %>% as_ts_dataloader(temp ~ date, timesteps = 20, horizon = 10, batch_size = 32) train_dl dataloader_next(dataloader_make_iter(train_dl))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.