Skip to main content

Collaborative Filtering for Implicit Feedback Datasets

Project description

Implicit

Build Status Documentation

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. Approximate nearest neighbours libraries such as Annoy, NMSLIB and Faiss can also be used by Implicit to speed up making recommendations.

Installation

Implicit can be installed from pypi with:

pip install implicit

Installing with pip will use prebuilt binary wheels on x86_64 Linux, Windows and OSX. These wheels include GPU support on Linux.

Implicit can also be installed with conda:

# CPU only package
conda install -c conda-forge implicit

# CPU+GPU package
conda install -c conda-forge implicit implicit-proc=*=gpu

Basic Usage

import implicit

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

# train the model on a sparse matrix of user/item/confidence weights
model.fit(user_item_data)

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

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

The examples folder has a program showing how to use this to compute similar artists on the last.fm dataset.

For more information see the documentation.

Articles about Implicit

These blog posts describe the algorithms that power this library:

There are also several other articles about using Implicit to build recommendation systems:

Requirements

This library requires SciPy version 0.16 or later and Python version 3.6 or later.

GPU Support requires at least version 11 of the NVidia CUDA Toolkit.

This library is tested with Python 3.7, 3.8, 3.9, 3.10 and 3.11 on Ubuntu, OSX and Windows.

Benchmarks

Simple benchmarks comparing the ALS fitting time versus Spark can be found here.

Optimal Configuration

I'd recommend configuring SciPy to use Intel's MKL matrix libraries. One easy way of doing this is by installing the Anaconda Python distribution.

For systems using OpenBLAS, I highly recommend setting 'export OPENBLAS_NUM_THREADS=1'. This disables its internal multithreading ability, which leads to substantial speedups for this package. Likewise for Intel MKL, setting 'export MKL_NUM_THREADS=1' should also be set.

Released under the MIT License

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

wbimplicit-0.6.2.1.tar.gz (69.9 kB view details)

Uploaded Source

Built Distributions

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

wbimplicit-0.6.2.1-cp311-cp311-manylinux2014_x86_64.whl (9.2 MB view details)

Uploaded CPython 3.11

wbimplicit-0.6.2.1-cp311-cp311-manylinux2014_aarch64.whl (885.2 kB view details)

Uploaded CPython 3.11

wbimplicit-0.6.2.1-cp310-cp310-manylinux2014_x86_64.whl (9.2 MB view details)

Uploaded CPython 3.10

wbimplicit-0.6.2.1-cp310-cp310-manylinux2014_aarch64.whl (886.7 kB view details)

Uploaded CPython 3.10

wbimplicit-0.6.2.1-cp39-cp39-manylinux2014_x86_64.whl (9.2 MB view details)

Uploaded CPython 3.9

wbimplicit-0.6.2.1-cp39-cp39-manylinux2014_aarch64.whl (900.3 kB view details)

Uploaded CPython 3.9

File details

Details for the file wbimplicit-0.6.2.1.tar.gz.

File metadata

  • Download URL: wbimplicit-0.6.2.1.tar.gz
  • Upload date:
  • Size: 69.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for wbimplicit-0.6.2.1.tar.gz
Algorithm Hash digest
SHA256 d03d79a1ec968786b5828069a50cecc3ac633668df07e504aebf5e2b88878757
MD5 348ed36a874a397d7c7abdc48dd0c95e
BLAKE2b-256 09ae8936408b30f63e4ff734a9a2e96b1abe59205dc808c38de8e3aeb35b57df

See more details on using hashes here.

File details

Details for the file wbimplicit-0.6.2.1-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wbimplicit-0.6.2.1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c689d5d16b0a5ffd5ee316fb1a565b6f9bff3624d173a1b65345e5ff3c026b7b
MD5 d836475e3ea313360e9520b46f961fd9
BLAKE2b-256 8f08ef2ebf62382776c9c9f40bc4d146f4ed9e3399d673aa3fd7d2af27edd5d6

See more details on using hashes here.

File details

Details for the file wbimplicit-0.6.2.1-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for wbimplicit-0.6.2.1-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c5b383acfbab19d86ef4304ea09106b0fa2498f54f06f3b19e349e73da59080c
MD5 3db1436d710dea8ba85f7323e69f2106
BLAKE2b-256 2043728aa44fbbb0ab05db771d3ee68f7b4baea3c0d7447211d7e8a1f4d757f8

See more details on using hashes here.

File details

Details for the file wbimplicit-0.6.2.1-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wbimplicit-0.6.2.1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4e65ed70d6dd96905d82dd23df7c6b1a7dd8e78bf38917073ab292928f452084
MD5 edb0e0f4ade654dbc37e03a429674d66
BLAKE2b-256 bfc35bef55da55a656484978dd934f5c65a12f31bc1dc970d636fb765af090ca

See more details on using hashes here.

File details

Details for the file wbimplicit-0.6.2.1-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for wbimplicit-0.6.2.1-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4257e9ad57cc34e85afd52c6e6e8c62b6c6f935998aa74c357be88959916a68a
MD5 111cc837b4621029240f3d4e44461076
BLAKE2b-256 4c2a39f4be007592a400e2dcd37087cee47e48e8717f0291d359878c90af5f48

See more details on using hashes here.

File details

Details for the file wbimplicit-0.6.2.1-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for wbimplicit-0.6.2.1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee023b7e112a1dc44a4bb5b1ff9e866eb1ef9688d3d33192dd5c87a174860815
MD5 a68c442fc275a3a62017debe54e74b3f
BLAKE2b-256 b0b2a595c6bf7f6a2664c99b648a623814b01b775dbc00a5784d9f2b285eb247

See more details on using hashes here.

File details

Details for the file wbimplicit-0.6.2.1-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for wbimplicit-0.6.2.1-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d131cbea7c0a963fc35c41be93ecd0e02301ab2620fbcded8aefc6df7fa4a044
MD5 0bccb6fbb4895f9a57913f5fe314a948
BLAKE2b-256 54d483f0876a42c1df42cc9ee26811f382badba0330c013ec778ffafc765fb86

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