Skip to main content

Recommender Utilities

This package (reco_utils) contains functions to simplify common tasks used when developing and evaluating recommender systems. A short description of the sub-modules is provided below. For more details about what functions are available and how to use them, please review the doc-strings provided with the code.

See the online documentation.

AzureML

The AzureML submodule contains utilities to train, tune and operationalize recommendation systems at scale using AzureML.

Common

This submodule contains high-level utilities for defining constants used in most algorithms as well as helper functions for managing aspects of different frameworks: gpu, spark, jupyter notebook.

Dataset

Dataset includes helper functions for interacting with Azure Cosmos databases, pulling different datasets and formatting them appropriately as well as utilities for splitting data for training / testing.

Data Loading

There are dataloaders for several datasets. For example, the movielens module will allow you to load a dataframe in pandas or spark formats from the MovieLens dataset, with sizes of 100k, 1M, 10M, or 20M to test algorithms and evaluate performance benchmarks.

df = movielens.load_pandas_df(size="100k")

Splitting Techniques

Currently three methods are available for splitting datasets. All of them support splitting by user or item and filtering out minimal samples (for instance users that have not rated enough item, or items that have not been rated by enough users).

  • Random: this is the basic approach where entries are randomly assigned to each group based on the ratio desired
  • Chronological: this uses provided timestamps to order the data and selects a cut-off time that will split the desired ratio of data to train before that time and test after that time
  • Stratified: this is similar to random sampling, but the splits are stratified, for example if the datasets are split by user, the splitting approach will attempt to maintain the same set of items used in both training and test splits. The converse is true if splitting by item.

Evaluation

The evaluation submodule includes functionality for performing hyperparameter sweeps as well as calculating common recommender metrics directly in python or in a Spark environment using pyspark.

Currently available metrics include:

  • Root Mean Squared Error
  • Mean Absolute Error
  • R2
  • Explained Variance
  • Precision at K
  • Recall at K
  • Normalized Discounted Cumulative Gain at K
  • Mean Average Precision at K
  • Area Under Curve
  • Logistic Loss

Recommender

The recommender submodule contains implementations of various algorithms that can be used in addition to external packages to evaluate and develop new recommender system approaches. A description of all the algorithms can be found on this table. Next a list of the algorithm utilities:

  • Cornac
  • DeepRec (includes xDeepFM and DKN)
  • FastAI
  • LightGBM
  • NCF
  • NewsRec (includes LSTUR, NAML NPA and NRMS)
  • RBM
  • RLRMC
  • SAR
  • Surprise
  • Vowpal Wabbit (VW)
  • Wide&Deep

Tuning

This submodule contains utilities for performing hyperparameter tuning.

Release files for recommender-utils 2021.2.post1623854186

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for recommender-utils 2021.2.post1623854186
File Size Uploaded
recommender-utils-2021.2.post1623854186.tar.gz 144.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for recommender-utils 2021.2.post1623854186
File Interpreter ABI Platform
recommender_utils-2021.2.post1623854186-py3-none-any.whl Python 3 none any Details

Total release size: 332.4 kB

Release files / recommender-utils-2021.2.post1623854186.tar.gz

Download URL recommender-utils-2021.2.post1623854186.tar.gz
Size 144.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6d25d94a96816ed3da04cfd55dabe7c0e0bf0fca3a15b6a9757c72357c3dec21
BLAKE2b-256 checksum
How to use checksums
d4c668e561d1e9e09733baee83391b0bcb5bb4c2b37f5beddd2f03ff1e13f3f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.10

Release files / recommender_utils-2021.2.post1623854186-py3-none-any.whl

Download URL recommender_utils-2021.2.post1623854186-py3-none-any.whl
Size 188.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
735a8068a5593812f8a2a739a374a8765f6ab8a43d083f477e69d8ccc283717a
BLAKE2b-256 checksum
How to use checksums
7279f05af46534b2b6d4094ec45b949ce47f36762ce4b88df0ba647f17abff34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.10

Release history Release notifications | RSS feed

This release

2021.2.post1623854186 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page