Description Usage Arguments Value See Also Examples
View source: R/tune_keras_rnn_predict.R
Use tuned RNN parameters with Keras functional API to train best performing model(s) and generate forecasts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | tune_keras_rnn_predict(
data,
model_type,
cv_setting,
bayes_best_par,
col_id = NULL,
col_date = "index",
col_value = "value",
level = 95,
iter = 10,
iter_dropout = 1000,
save_model = NULL,
save_model_id = NULL
)
|
data |
Univariate time series (data.frame) with date and value column,
specified in |
model_type |
One of "simple", "gru" or "lstm" |
cv_setting |
list of "periods_train", "periods_val", "periods_test" and "skip_span" for rolling_origin |
bayes_best_par |
tuned hyperparameters, from |
col_id |
Optional ID column in |
col_date |
Date column in |
col_value |
Value column in |
level |
level for prediction interval in percentage |
iter |
number of neural networks to train per split with same hyperparameters |
iter_dropout |
number of iterations for prediction intervals calculated by monte carlo dropout |
save_model |
Automatically save tuned models? Specify NULL for No or character vector with path to directory for yes |
save_model_id |
optional id for model filename |
list of forecasts per split
Other RNN tuning with Keras:
tune_keras_rnn_bayesoptim()
,
tune_keras_rnn_eval()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
apple <- tsRNN::DT_apple
bayes_best_par <- purrr::map(
readRDS(system.file("tinytest_data/apple_bayesoptim.rds", package = "tsRNN")),
"Best_Par"
)
cv_setting <- list(
periods_train = 90,
periods_val = 10,
periods_test = 10,
skip_span = 5
)
result <- tune_keras_rnn_predict(
data = apple,
model_type = "simple",
cv_setting = cv_setting,
bayes_best_par = bayes_best_par
)
result
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.