The RNN companion object provides factory methods.
Attributes
Members list
Value members
Concrete methods
Builds the input and output matrices for time series forecasting. This function takes a target vector and creates input and output matrices for time series forecasting. The input matrix is created using the specified number of lags, and the output matrix is created using the specified forecasting horizon. The function prints the dimensions of the input and output matrices and the value of the last element in the target vector.
Builds the input and output matrices for time series forecasting. This function takes a target vector and creates input and output matrices for time series forecasting. The input matrix is created using the specified number of lags, and the output matrix is created using the specified forecasting horizon. The function prints the dimensions of the input and output matrices and the value of the last element in the target vector.
Value parameters
- backcast
-
A boolean flag indicating whether to include backcasting (default is true)
- hh
-
the forecasting horizon (number of future steps to predict)
- lags
-
the number of lags to use for creating the input matrix
- y
-
the target vector of shape [n_samples]
Attributes
- Returns
-
A tuple containing two matrices: - The input matrix of shape [n_samples - lags, lags] - The output matrix of shape [n_samples - 1, hh]
Creates sequences for the RNN model from the input and output matrices. This function takes the input and output matrices and creates sequences of a specified length. Each sequence is a slice of the original matrices, and the function returns tensors containing these sequences.
Creates sequences for the RNN model from the input and output matrices. This function takes the input and output matrices and creates sequences of a specified length. Each sequence is a slice of the original matrices, and the function returns tensors containing these sequences.
Value parameters
- sequence_length
-
the length of each sequence
- x
-
the input matrix of shape [n_samples, n_features]
- yy
-
the output matrix of shape [n_samples, n_output_features]
Attributes
- Returns
-
A tuple containing two tensors: - x_sequences: The input sequences tensor of shape [sequence_length, n_features, n_sequences] - y_sequences: The output sequences tensor of shape [sequence_length, n_output_features, n_sequences]