torchts quick API

torchts_rnn()

RNN model for time series forecasting

torchts_mlp()

MLP model for time series forecasting

parsnip API

rnn()

General interface to recurrent neural network models

Modules

model_rnn()

A configurable recurrent neural network model

model_mlp()

A configurable feed forward network (Multi-Layer Perceptron) with embedding

nn_multi_embedding()

Create multiple embeddings at once

nn_nonlinear()

Shortcut to create linear layer with nonlinear activation function

nn_mlp()

A shortcut to create a feed-forward block (MLP block)

Data transformations

as_tensor()

Convert an object to tensor

ts_dataset()

Create a time series dataset from a torch_tensor matrix

as_ts_dataset()

Create a torch dataset for time series data from a data.frame-like object

as_ts_dataloader()

Quick shortcut to create a torch dataloader based on the given dataset

as.vector(<torch_tensor>)

Convert torch_tensor to a vector

Metrics

nnf_mae()

Mean absolute error

nnf_mape()

Mean absolute percentage error

nnf_smape()

Symmetric mean absolute percentage error

Utils

is_categorical()

Check, if vector is categorical, i.e. if is logical, factor, character or integer

dict_size()

Return size of categorical variables in the data.frame

embedding_size_google() embedding_size_fastai()

Propose the length of embedding vector for each embedded feature.

clear_outcome()

Partially clear outcome variable in new data by overriding with NA values

set_device()

Set model device.

plot_forecast()

Plot forecast vs ground truth

Data

weather_pl

Weather data from Polish "poles of extreme temperatures" in 2001-2020

tiny_m5

A subset from M5 Walmart Challenge Dataset in one data frame