Description Usage Arguments Value Tuning Bounds See Also Examples
View source: R/tune_keras_rnn_bayesoptim.R
Tune recurrent neural network with Keras functional API and Bayes Optimization to select best performing model
1 2 3 4 5 6 7 8 9 10 11 |
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 |
tuning_bounds |
list of tuning parameters - see section "Tuning Bounds" |
col_id |
Optional ID column in |
col_date |
Date column in |
col_value |
Value column in |
save |
Automatically save tuning results? Specify NULL if not or character vector with path to directory for yes |
save_id |
optional character id for model filename |
list of Bayes Optimization results per split
The following parameters are (currently) available for tuning.
lag_1 (integer(2)) lower bounds - default c(1L, 2L)
lag_2 (integer(2)) upper bounds - default c(1L, 2L)
n_units (integer(2)) lower and upper bound for rnn units (cells) - default c(8L, 32L)
n_epochs (integer(2)) lower and upper bound for epochs - default c(20L, 50L)
optimizer_type (integer(2)) lower and upper bound for optimizer:
1 = "rmsprop", 2 = "adam", 3 = "adagrad" - default c(1L, 3L)
dropout = (numeric(2)) lower and upper bound for dropout rate - default c(0, 0.5)
recurrent_dropout = (numeric(2)) lower and upper bound for recurrent dropout rate - default c(0, 0.5)
learning_rate = (numeric(2)) lower and upper bound for learning rate - default c(0.001, 0.01)
Keep attention to the correct type (numeric length 2 / integer length 2).
All bounds are to be set, otherwise default serves as fallback.
Other RNN tuning with Keras:
tune_keras_rnn_eval()
,
tune_keras_rnn_predict()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
apple <- tsRNN::DT_apple
cv_setting <- list(
periods_train = 90,
periods_val = 10,
periods_test = 10,
skip_span = 5
)
bayes <- tune_keras_rnn_bayesoptim(apple, model_type = "simple", cv_setting)
bayes
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.