This function is a wrapper for a two layered neural network written using the Keras Package. It takes a
1 2 3 4 5 | nn_twolayer(Text, Codes, Words = 10000, Seed = 17,
Weighting = "count", Train_prop = 0.5, Epochs = 3, Units = 512,
Batch = 32, Dropout = 0.2, Valsplit = 0.1,
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 |
Weighting |
The type of feature weighting used in the document feature matrix. I.e., count and tfidf. |
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. |
Units |
The number of network nodes used in the first layer of the sequential model |
Batch |
The number of batches estimated |
Dropout |
A floating variable bound between 0 and 1. It determines the rate at which units are dropped for the linear tranformation of the inputs. |
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 |
ValSplit |
The validation split of the data used in the training of the LSTM model |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.