asreview.models.classifiers.LSTMPoolClassifier

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

LSTM-pool classifier (lstm-pool).

LSTM model that consists of an embedding layer, LSTM layer with many outputs, max pooling 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 asreview[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.

  • lstm_pool_size (int) – Size of the pool, must be a divisor of max_sequence_length.

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

  • 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.