API References

Evaluators

Evaluator

Evaluates recommenders' performance against validation set.

EvaluatorWithColdUser

Evaluates recommenders' performance against cold (unseen) users.

Recommenders

BaseRecommender

The base class for all (hot) recommenders.

TopPopRecommender

A simple recommender system based on the popularity of the items in the training set (without any personalization).

IALSRecommender

Implementation of implicit Alternating Least Squares (iALS) or Weighted Matrix Factorization (WMF).

P3alphaRecommender

Recommendation with 3-steps random walk, proposed in

RP3betaRecommender

3-Path random walk with the item-popularity penalization:

TruncatedSVDRecommender

Use (randomized) SVD to factorize the input matrix into low-rank matrices.

CosineKNNRecommender

K-nearest neighbor recommender system based on cosine similarity.

AsymmetricCosineKNNRecommender

K-nearest neighbor recommender system based on asymmetric cosine similarity.

JaccardKNNRecommender

K-nearest neighbor recommender system based on Jaccard similarity.

TverskyIndexKNNRecommender

K-nearest neighbor recommender system based on Tversky Index.

CosineUserKNNRecommender

K-nearest neighbor recommender system based on cosine similarity.

AsymmetricCosineUserKNNRecommender

K-nearest neighbor recommender system based on asymmetric cosine similarity.

SLIMRecommender

SLIM with ElasticNet-type loss function:

DenseSLIMRecommender

Implementation of DenseSLIM or Embarrassingly Shallow AutoEncoder (EASE ^R).

get_recommender_class

Get recommender class from its class name.

A LightFM wrapper for BPR matrix factorization (requires a separate installation of lightFM).

BPRFMRecommender

A LightFM wrapper for our interface.

As a reference code based on neural networks, we have implemented a JAX version of Mult-VAE, which requires jax, jaxlib, dm-haiku, and optax:

MultVAERecommender

JAX implementation of Mult-VAE, presented in "Variational Autoencoders for Collaborative Filtering".

Split Functions

UserTrainTestInteractionPair

A class to hold users' train & test (if any) interactions and their ids.

rowwise_train_test_split

Splits the non-zero elements of a sparse matrix into two (train & test interactions).

split_dataframe_partial_user_holdout

Splits the DataFrame and build an interaction matrix, holding out random interactions for a subset of randomly selected users (whom we call "validation users" and "test users").

holdout_specific_interactions

Holds-out (part of) the interactions specified by the users.

split_last_n_interaction_df

Split a dataframe holding out last n_heldout or last heldout_ratio part of interactions of the users.

Utilities

ItemIDMapper

A utility class that helps mapping item IDs to indices or vice versa.

IDMapper

A utility class that helps mapping user/item IDs to indices or vice versa.

Dataset

MovieLens1MDataManager

Manages MovieLens 1M dataset.

MovieLens100KDataManager

Manages MovieLens 100K dataset.

MovieLens20MDataManager

NeuMFML1MDownloader

Manages MovieLens 1M dataset split under 1-vs-100 negative evaluation protocol.