elliot.recommender.neural.NeuMF package

Submodules

elliot.recommender.neural.NeuMF.neural_matrix_factorization module

Module description:

class elliot.recommender.neural.NeuMF.neural_matrix_factorization.NeuMF(data, config, params, *args, **kwargs)[source]

Bases: elliot.recommender.recommender_utils_mixin.RecMixin, elliot.recommender.base_recommender_model.BaseRecommenderModel

Neural Collaborative Filtering

For further details, please refer to the paper

Parameters
  • mf_factors – Number of MF latent factors

  • mlp_factors – Number of MLP latent factors

  • mlp_hidden_size – List of units for each layer

  • lr – Learning rate

  • dropout – Dropout rate

  • is_mf_train – Whether to train the MF embeddings

  • is_mlp_train – Whether to train the MLP layers

To include the recommendation model, add it to the config file adopting the following pattern:

models:
  NeuMF:
    meta:
      save_recs: True
    epochs: 10
    batch_size: 512
    mf_factors: 10
    mlp_factors: 10
    mlp_hidden_size: (64,32)
    lr: 0.001
    dropout: 0.0
    is_mf_train: True
    is_mlp_train: True
get_recommendations(k: int = 100)[source]
property name
train()[source]

elliot.recommender.neural.NeuMF.neural_matrix_factorization_model module

Module description:

class elliot.recommender.neural.NeuMF.neural_matrix_factorization_model.NeuralMatrixFactorizationModel(*args, **kwargs)[source]

Bases: tensorflow.python.keras.engine.training.Model

call(inputs, training=None, mask=None)[source]
get_recs(inputs, training=False, **kwargs)[source]

Get full predictions on the whole users/items matrix.

Returns

The matrix of predicted values.

get_top_k(preds, train_mask, k=100)[source]
predict(inputs, training=False, **kwargs)[source]

Get full predictions on the whole users/items matrix.

Returns

The matrix of predicted values.

train_step(batch)[source]

Module contents