This function is a wrapper for a long term short term neural network written using the Keras Package.
1 2 3 4 5 6 7 | nn_embedded_lstm_cnn(Text, Codes, Words = 7000, Seed = 17,
Train_prop = 0.8, Epochs = 4, Batch = 64, MaxSentencelen = 40,
WordEmbedDim = 60, ValSplit = 0.1, Dropout_layer_1 = 0.6,
Dropout_layer_2 = 0.3, Dropout_layer_3 = 0.3, Filter = 48,
Kernel_size = 5, Pool_size = 4, Units_lstm = 128,
Metric = "binary_accuracy", Loss = "binary_crossentropy",
Optimizer = "adam", CM = TRUE, Model = FALSE)
|
Text |
The text that will be used as training and test data. |
Codes |
The codes that will be used as outcomes to be predicted by the NN model. |
Words |
The number of top words included in document feature matrixes used as training and testing data. |
Seed |
The seed used in the model. Defaults to 17 |
Train_prop |
The proportion of the data used to train the model. The remainder is used as test data. |
Epochs |
The number of epochs used in the NN model. |
Batch |
The number of batches estimated in the NN. |
MaxSentencelen |
All sentences will be truncated to this length to be input into the LSTM model |
WordEmbedDim |
The number of word embedding dimensions to be produced by the LSTM model |
ValSplit |
The validation split of the data used in the training of the LSTM model |
Dropout_layer_1 |
A floating variable that determines the rate at which units are dropped in the first layer of the sequential model. |
Dropout_layer_2 |
A floating variable bound between 0 and 1. It determines the rate at which units are dropped for the linear tranformation of the inputs. |
Dropout_layer_3 |
A floating variable bound between 0 and 1. It determines the fraction of the units to drop for the linear transformation of the recurrent neural network layer. |
Filter |
|
Kernel_size |
|
Pool_size |
|
Units_lstm |
The number of network nodes used in the LSTM layer |
Metric |
Metric used to train algorithm |
Loss |
Metric used to train algorithm |
Optimizer |
Optimizer used to fit model to training data |
CM |
A logical variable that indicates whether a confusion matrix will be output from the function |
Model |
A logical variable that indicates whether the trained model should be included in the output of this function |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.