asreview.models.classifiers.LSTMBaseClassifier

class asreview.models.classifiers.LSTMBaseClassifier(embedding_matrix=None, backwards=True, dropout=0.4, optimizer='rmsprop', lstm_out_width=20, learn_rate=1.0, dense_width=128, verbose=0, batch_size=32, epochs=35, shuffle=False, class_weight=30.0)[source]

LSTM-base classifier (lstm-base).

LSTM model that consists of an embedding layer, LSTM layer with one output, dense layer, and a single sigmoid output node. Use the asreview.models.feature_extraction.EmbeddingLSTM feature extraction method. Currently not so well optimized and slow.

Note

This model requires tensorflow to be installed. Use pip install tensorflow or install all optional ASReview dependencies with pip install asreview[all]

Parameters
  • embedding_matrix (numpy.ndarray) – Embedding matrix to use with LSTM model.

  • backwards (bool) – Whether to have a forward or backward LSTM.

  • dropout (float) – Value in [0, 1.0) that gives the dropout and recurrent dropout rate for the LSTM model.

  • optimizer (str) – Optimizer to use.

  • lstm_out_width (int) – Output width of the LSTM.

  • learn_rate (float) – Learn rate multiplier of default learning rate.

  • dense_width (int) – Size of the dense layer of the model.

  • verbose (int) – Verbosity.

  • batch_size (int) – Size of the batch size for the LSTM model.

  • epochs (int) – Number of epochs to train the LSTM model.

  • shuffle (bool) – Whether to shuffle the data before starting to train.

  • class_weight (float) – Class weight for the included papers.

Attributes

default_param

Get the default parameters of the model.

label

name

param

Get the (assigned) parameters of the model.

Methods

fit(X, y)

Fit the model to the data.

full_hyper_space()

Get a hyperparameter space to use with hyperopt.

hyper_space()

predict_proba(X)

Get the inclusion probability for each sample.