pred.tskeras: Time series forecasts for a keras model.

View source: R/mod_deeplearning_utils.R

pred.tskerasR Documentation

Time series forecasts for a keras model.

Description

Time series forecasts for a keras model.

Usage

pred.tskeras(object, h = 1)

Arguments

object

An object from keras.

h

Number of periods for forecasting.

Value

Point forecasts as a time series.

Author(s)

Diego Jimenez <diego.jimenez@promidat.com>

Examples


  library(keras)
  modelo.deep <- keras_model_sequential() %>% 
  layer_lstm(
    units = 10, activation = 'tanh', batch_input_shape = c(1, 12, 1),
    return_sequences = TRUE, stateful = TRUE) %>%
  layer_dense(units = 1) %>%
  compile(loss = 'mse', optimizer = 'adam', metrics = 'mse')
  modelo.deep <- tskeras(AirPassengers, modelo.deep, lag = 12, epochs = 1)
  pred.tskeras(modelo.deep, h = 12)



forecasteR documentation built on July 9, 2023, 6:37 p.m.