Description Usage Arguments Detail Examples
buildRNN
extends the class RS
to SM.rnn
by constructing and validating
Keras models.
1 2 3 4 5 6 7 |
object |
A RS class. |
compile_options |
A list contaning the follow compile options: optimizer, loss and metrics. In case of missing ones of those indicators, default values are setted automatically:
.
For more detail, check |
hyperparameters |
A list contaning the follow parameters of Keras model:
Note: a vector input is acceptable for each hyperparameter, in this case gridsearch will be applied. |
preprocess_method |
A character value indicating data preparation method, available methos are
|
lag |
A integer value indicating how many previous data should be included in the data preparation process. |
model_path |
A string value indicating where should the model to be stored. |
If lag is diferent a zero, the input data will be transformed to a new input with column number equal to 2x(lag + 1), named n_col. Once the data preparetion is done including the preprocess method, a Keras sequential model is constructed with following layers:
a simple layer with input shape equal to c(n_col, 1) and output shape equal to n_col,
a simple rnn layer with n_col units,
a simple layer with one unit with linear activation.
This model will be trained by first (1 - validation_split)% rows (the last test_split part to test the model) and validated by the last validations_split%. Once the model is done, it will be store to the model path because the S4 object can not treat the keras model as slot object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
n <- 50
# An example to create the RS class.
my_first_class <- RS(sigb = rnorm(n, mean = 0, sd = 1),
epsb = rnorm(n, mean = 0, sd = 2),
epsp = rnorm(n, mean = 1, sd = 1))
compile_options <- list()
hyperparameters <- list(batch_size = c(16, 32, 64),
epochs = c(10, 20, 50))
preprocess_method <- "maxmin"
lag <- 5
model_path <- "~/Desktop/pans_model"
myRNN <- buildRNN(object = myclass, compile_options = list(), hyperparameters = hyperparameters,
preprocess_method = preprocess_method, lag = lag, model_path = model_path)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.