normalizor | R Documentation |
This function normalizes a matrix of features using precomputed means and standard deviations.
The function automatically runs load.scaler
to read the standard deviations and means of the features,
which are organized into a list
object named data.scaler.LSTM
.
These means and standard deviations are computed from
the 1,000,000 datasets data.datasets.LSTM
for
training the pre-trained Long Short Term Memory (LSTM) Network.
normalizor(features)
features |
A numeric matrix where each row represents an observation and each column represents a feature. |
The function applies z-score normalization to each element in the features
matrix. It uses
the scaler
object, which is expected to contain precomputed means and standard deviations for each feature.
The normalized value for each element is computed as:
z = \frac{x - \mu}{\sigma}
where x
is the original value, \mu
is the mean, and \sigma
is the standard deviation.
A matrix of the same dimensions as features
, where each feature has been normalized.
LSTM
, load.scaler
, data.datasets.LSTM
, data.scaler.LSTM
library(LSTMfactors)
set.seed(123)
##Take the data.DAPCS dataset as an example.
data(data.DAPCS)
response <- as.matrix(data.DAPCS[, 3:22]) ## loading data
## Run extractor.feature function
features <- extractor.feature(response)
features.nor <- normalizor(features)
print(features.nor)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.