elliot.recommender.latent_factor_models.PMF package

Submodules

elliot.recommender.latent_factor_models.PMF.probabilistic_matrix_factorization module

Module description:

Mnih, Andriy, and Russ R. Salakhutdinov. “Probabilistic matrix factorization.” Advances in neural information processing systems 20 (2007)

class elliot.recommender.latent_factor_models.PMF.probabilistic_matrix_factorization.PMF(data, config, params, *args, **kwargs)[source]

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

Probabilistic Matrix Factorization

For further details, please refer to the paper

Parameters
  • factors – Number of latent factors

  • lr – Learning rate

  • reg – Regularization coefficient

  • gaussian_variance – Variance of the Gaussian distribution

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

models:
  PMF:
    meta:
      save_recs: True
    epochs: 10
    batch_size: 512
    factors: 50
    lr: 0.001
    reg: 0.0025
    gaussian_variance: 0.1
get_recommendations(k: int = 100)[source]
property name
predict(u: int, i: int)[source]
train()[source]

elliot.recommender.latent_factor_models.PMF.probabilistic_matrix_factorization_model module

Module description:

Mnih, Andriy, and Russ R. Salakhutdinov. “Probabilistic matrix factorization.” Advances in neural information processing systems 20 (2007)

class elliot.recommender.latent_factor_models.PMF.probabilistic_matrix_factorization_model.ProbabilisticMatrixFactorizationModel(*args, **kwargs)[source]

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

call(inputs, training=None, mask=None)[source]
dot_prod(layer_0, layer_1)[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