Learn R Programming

daltoolboxdp (version 1.2.737)

ts_lstm: LSTM

Description

Time series forecaster using an LSTM neural network. Wraps a PyTorch implementation via reticulate.

Usage

ts_lstm(preprocess = NA, input_size = NA, epochs = 10000L)

Value

A ts_lstm object.

Arguments

preprocess

Optional preprocessing/normalization object.

input_size

Integer. Number of lagged inputs per training example.

epochs

Integer. Maximum number of training epochs.

References

Hochreiter, S., & Schmidhuber, J. (1997). Long Short-Term Memory.

Examples

Run this code
if (FALSE) {
# LSTM forecaster expects a frame where 't0' is the target during fitting.
# The R wrapper constructs it from (x, y), so you usually call do_fit via tspredit.

# Minimal construction (see vignette for full workflow)
tsf <- ts_lstm(input_size = 12, epochs = 1000L)
# model <- daltoolbox::fit(tsf, your_data)  # delegated to tspredit
}

# See:
# https://github.com/cefet-rj-dal/daltoolbox/blob/main/timeseries/ts_lstm.md

Run the code above in your browser using DataLab