Fast Python Collaborative Filtering for Implicit Datasets

This project provides fast Python implementations of several different popular recommendation algorithms for implicit feedback datasets:

All models have multi-threaded training routines, using Cython and OpenMP to fit the models in parallel among all available CPU cores. In addition, the ALS and BPR models both have custom CUDA kernels - enabling fitting on compatible GPU’s. This library also supports using approximate nearest neighbours libraries such as Annoy, NMSLIB and Faiss for speeding up making recommendations.

Basic Usage

import implicit

# initialize a model
model = implicit.als.AlternatingLeastSquares(factors=64)

# train the model on a sparse matrix of user/item/confidence weights

# recommend items for a user
recommendations = model.recommend(userid, user_item_data[userid])

# find related items
related = model.similar_items(itemid)

Indices and tables