Skip to main content

LightFM

Important

This is a fork of the original LightFM project

  1. Our main goal is to support emerging dependencies like newest versions of Python and to fix compatibility issues.
  2. We DO NOT guarantee support for all systems.
  3. We DO NOT intend to expand or change any existing LightFM functionality.
  4. We might fix essential bugs.

About us: we are maintainers of the RecTools recommender systems framework. Our wrapper for LightFM provides 10-15 faster inference then the original model (benchmark).
In RecTools we support common RecSys models and validation tools in one easy-to-use framework.

LightFM logo

PyPI

LightFM is a Python implementation of a number of popular recommendation algorithms for both implicit and explicit feedback, including efficient implementation of BPR and WARP ranking losses. It's easy to use, fast (via multithreaded model estimation), and produces high quality results.

It also makes it possible to incorporate both item and user metadata into the traditional matrix factorization algorithms. It represents each user and item as the sum of the latent representations of their features, thus allowing recommendations to generalise to new items (via item features) and to new users (via user features).

For more details, see the Original Documentation.

Installation

Install from pip:

pip install rectools-lightfm

Quickstart

Fitting an implicit feedback model on the MovieLens 100k dataset is very easy:

from lightfm import LightFM
from lightfm.datasets import fetch_movielens
from lightfm.evaluation import precision_at_k

# Load the MovieLens 100k dataset. Only five
# star ratings are treated as positive.
data = fetch_movielens(min_rating=5.0)

# Instantiate and train the model
model = LightFM(loss='warp')
model.fit(data['train'], epochs=30, num_threads=2)

# Evaluate the trained model
test_precision = precision_at_k(model, data['test'], k=5).mean()

Articles and tutorials on using LightFM

  1. Learning to Rank Sketchfab Models with LightFM
  2. Metadata Embeddings for User and Item Cold-start Recommendations
  3. Recommendation Systems - Learn Python for Data Science
  4. Using LightFM to Recommend Projects to Consultants

Release files for rectools-lightfm 1.17.3

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

Source distribution (sdist)

Source distribution for rectools-lightfm 1.17.3
File Size Uploaded
rectools-lightfm-1.17.3.tar.gz 411.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rectools-lightfm 1.17.3
File Interpreter ABI Platform
rectools_lightfm-1.17.3-cp39-cp39-macosx_10_9_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.9+ x86-64 Details

Total release size: 945.5 kB

Release files / rectools-lightfm-1.17.3.tar.gz

Download URL rectools-lightfm-1.17.3.tar.gz
Size 411.7 kB
Tags Source
SHA-256 checksum
How to use checksums
81625340e6cfc5854c0c69269d924d1ae34bedcbf3562680ee4aa2e093d824a9
BLAKE2b-256 checksum
How to use checksums
a4da3867c5de0f51b4fb632bb5fdcb303dd3d903b5eb17cf7cccdfc6836cc76c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.13

Release files / rectools_lightfm-1.17.3-cp39-cp39-macosx_10_9_x86_64.whl

Download URL rectools_lightfm-1.17.3-cp39-cp39-macosx_10_9_x86_64.whl
Size 533.8 kB
Tags CPython 3.9 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
a524f2ad3e7efa7781fee46e04962ee114c603d5589b07fe632b22d81c9ed970
BLAKE2b-256 checksum
How to use checksums
48b39d7c93356a9d386eea9395353a8c6d8d0b3e3760309c83722cf79532ca54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.13

Release history Release notifications | RSS feed

This release

1.17.3 This release

2 release files

1.17.2

2 release files

1.17.1

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