elliot.recommender.knowledge_aware.kahfm_embeddings package

Submodules

elliot.recommender.knowledge_aware.kahfm_embeddings.kahfm_embeddings module

Module description:

class elliot.recommender.knowledge_aware.kahfm_embeddings.kahfm_embeddings.KaHFMEmbeddings(data, config, params, *args, **kwargs)[source]

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

Knowledge-aware Hybrid Factorization Machines (Tensorflow Embedding-based Variant)

Vito Walter Anelli and Tommaso Di Noia and Eugenio Di Sciascio and Azzurra Ragone and Joseph Trotta “How to Make Latent Factors Interpretable by Feeding Factorization Machines with Knowledge Graphs”, ISWC 2019 Best student Research Paper For further details, please refer to the paper

Vito Walter Anelli and Tommaso Di Noia and Eugenio Di Sciascio and Azzurra Ragone and Joseph Trotta “Semantic Interpretation of Top-N Recommendations”, IEEE TKDE 2020 For further details, please refer to the paper

Parameters
  • lr – learning rate (default: 0.0001)

  • l_w – Weight regularization (default: 0.005)

  • l_b – Bias regularization (default: 0)

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

models:
  KaHFMEmbeddings:
    meta:
      hyper_max_evals: 20
      hyper_opt_alg: tpe
      validation_rate: 1
      verbose: True
      save_weights: True
      save_recs: True
      validation_metric: nDCG@10
    epochs: 100
    batch_size: -1
    lr: 0.0001
    l_w: 0.005
    l_b: 0
get_recommendations(k: int = 100)[source]
property name
train()[source]

elliot.recommender.knowledge_aware.kahfm_embeddings.kahfm_embeddings_model module

Module description:

class elliot.recommender.knowledge_aware.kahfm_embeddings.kahfm_embeddings_model.KaHFMEmbeddingsModel(*args, **kwargs)[source]

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

call(inputs, training=None, **kwargs)[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_top_k(preds, train_mask, k=100)[source]
predict(inputs, training=False, **kwargs)[source]
predict_batch(start, stop)[source]
train_step(batch)[source]

elliot.recommender.knowledge_aware.kahfm_embeddings.tfidf_utils module

class elliot.recommender.knowledge_aware.kahfm_embeddings.tfidf_utils.TFIDF(map: Dict[int, List[int]])[source]

Bases: object

get_profiles(ratings: Dict[int, Dict[int, float]])[source]
tfidf()[source]

Module contents