Skip to main content

An implementation of Embarrassingly Shallow Autoencoders

Project description

EASEy

An implementation of Embarrassingly Shallow Autoencoders (EASE).

EASE is a state-of-the-art prediction model for collaborative filtering on implicit feedback.

When to use EASE and when not to use EASE

EASE consistently performs near the top of recommender system benchmarks (see live benchmark). It outperforms many deep learning and graph-based approaches (see paper).

EASE is best when the number of items is small, because the most computationally complex part of training is taking the inverse of an item x item cooccurrence matrix. The good news is, this complexity is independent of the number of users or interactions.

EASE also doesn't take into account any item or user features like more complex models - it uses interactions only.

Given these two constraints, EASE is a great tool for:

  • Standalone prediction - Raw EASE scores are highly predictive
  • Candidate generation - Limit the item space to a set of relevant candidates per user
  • Feature engineering - EASE scores can be used in downstream models (e.g., a classification GBM)

Installation

pip install easey       # works on all machines
pip install easey[mkl]  # faster training and inference on Intel CPU

EASEy depends on scipy and numpy for sparse and dense matrix operations. It also depends on narwhals for DataFrame-agnostic operations.

sparse_dot_mkl is an optional dependency that uses the Intel MKL library for parallel computation of the gram matrix (X^TX) and for faster dot products. It is generally 2-4x faster than baseline scipy.

It is simplest to install sparse_dot_mkl with conda because this ensures that MKL is linked properly. Otherwise, you will have to install the Intel MKL package on your system.

Usage

EASEy is compatible with both pandas and polars DataFrames. Technically it's compatible with any object that has array-like values accessible with index [] syntax, even a basic dict. The EASE class has two public methods - fit and predict - for training and inference respectively.

EASE has only one hyperparameter, lambda, for L2 regularization. In the original paper, values from 200 to 1,000 were found to be optimal. Lower values lead to more long-tail recommendations at the expense of possible overfitting. Higher values lead to recommending more popular items.

See movielens_example.ipynb for a simple training and inference example.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easey-0.5.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easey-0.5.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file easey-0.5.0.tar.gz.

File metadata

  • Download URL: easey-0.5.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for easey-0.5.0.tar.gz
Algorithm Hash digest
SHA256 c0e69fcdd90a96e16e9a4951fcf341b1f75e8103fde9b6e49a9d937def9d0c64
MD5 b0c03060cd371180e888dfcf944545f9
BLAKE2b-256 f34a1f498cb69540fbb4c3f38618f0fe58961c78f7106c0be89b667f41f88c11

See more details on using hashes here.

File details

Details for the file easey-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: easey-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.25 {"installer":{"name":"uv","version":"0.11.25","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for easey-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 877360ae555f252f8ed8872517baf6efd9aec172abd69a27671ceb21d2d21773
MD5 59a3c7a9aeb4c4f7f818a6cf7ad391d2
BLAKE2b-256 8c37718bb833c5d6bd7827256d5f3de00f84617a6b40b3bee5cd5eb172756ad4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page