elliot.recommender.latent_factor_models.FISM package

Submodules

elliot.recommender.latent_factor_models.FISM.FISM module

Module description:

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

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

FISM: Factored Item Similarity Models

For further details, please refer to the paper

Parameters
  • factors – Number of factors of feature embeddings

  • lr – Learning rate

  • beta – Regularization coefficient for latent factors

  • lambda – Regularization coefficient for user bias

  • gamma – Regularization coefficient for item bias

  • alpha – Alpha parameter (a value between 0 and 1)

  • neg_ratio – ratio of sampled negative items

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

models:
  FISM:
    meta:
      save_recs: True
    epochs: 10
    batch_size: 512
    factors: 10
    lr: 0.001
    alpha: 0.5
    beta: 0.001
    lambda: 0.001
    gamma: 0.001
    neg_ratio: 0.5
get_recommendations(k: int = 100)[source]
property name
train()[source]

elliot.recommender.latent_factor_models.FISM.FISM_model module

Module description:

class elliot.recommender.latent_factor_models.FISM.FISM_model.FISM_model(*args, **kwargs)[source]

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

batch_predict(user_start, user_stop, **kwargs)[source]
call(inputs, training=None)[source]
create_history_item_matrix()[source]
get_config()[source]

Returns the config of the layer.

A layer config is a Python dictionary (serializable) containing the configuration of a layer. The same layer can be reinstantiated later (without its trained weights) from this configuration.

The config of a layer does not include connectivity information, nor the layer class name. These are handled by Network (one layer of abstraction above).

Returns

Python dictionary.

get_positions(predictions, train_mask, items, inner_test_user_true_mask)[source]
get_top_k(predictions, train_mask, k=100)[source]
predict(user, **kwargs)[source]
train_step(batch)[source]
class elliot.recommender.latent_factor_models.FISM.FISM_model.LatentFactor(*args, **kwargs)[source]

Bases: tensorflow.python.keras.layers.embeddings.Embedding

censor(censor_id)[source]

Module contents

Module description: