asreview.models.classifiers.NN2LayerClassifier
- class asreview.models.classifiers.NN2LayerClassifier(dense_width=128, optimizer='rmsprop', learn_rate=1.0, regularization=0.01, verbose=0, epochs=35, batch_size=32, shuffle=False, class_weight=30.0)[source]
Fully connected neural network (2 hidden layers) classifier (
nn-2-layer
).Neural network with two hidden, dense layers of the same size.
Recommended feature extraction model is
asreview.models.feature_extraction.Doc2Vec
.Note
This model requires
tensorflow
to be installed. Usepip install tensorflow
or install all optional ASReview dependencies withpip install asreview[all]
Warning
Might crash on some systems with limited memory in combination with
asreview.models.feature_extraction.Tfidf
.- Parameters
dense_width (int) – Size of the dense layers.
optimizer (str) – Name of the Keras optimizer.
learn_rate (float) – Learning rate multiplier of the default learning rate.
regularization (float) – Strength of the regularization on the weights and biases.
verbose (int) – Verbosity of the model mirroring the values for Keras.
epochs (int) – Number of epochs to train the neural network.
batch_size (int) – Batch size used for the neural network.
shuffle (bool) – Whether to shuffle the training data prior to training.
class_weight (float) – Class weights for inclusions (1’s).
Attributes
Get the default parameters of the model.
Get the (assigned) parameters of the model.
Methods
fit
(X, y)Fit the model to the data.
Get a hyperparameter space to use with hyperopt.
Get the inclusion probability for each sample.