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

There are binary packages on conda-forge for Linux, Windows and OSX. These can be installed with:

conda install -c conda-forge implicit

There are also GPU enabled packages on conda-forge for x86_64 Linux systems using either CUDA 11.0, 11.1 or 11.2. The GPU packages can be installed with:

conda install -c conda-forge implicit implicit-proc=*=gpu

There is also an sdist package on PyPi. This package can be installed with:

pip install implicit

Note that installing with pip requires a C++ compiler to be installed on your system, since this method will build implicit from source.

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 blog posts about using Implicit to build recommendation systems:

Requirements

This library requires SciPy version 0.16 or later and Python version 3.6 or later. Running on OSX requires an OpenMP compiler, which can be installed with homebrew: brew install gcc.

GPU Support requires at least version 11 of the NVidia CUDA Toolkit. The build will use the nvcc compiler that is found on the path, but this can be overridden by setting the CUDAHOME environment variable to point to your cuda installation.

This library has been tested with Python 3.6, 3.7, 3.8 and 3.9 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

implicit-0.5.2.tar.gz (71.6 kB view details)

Uploaded Source

Built Distributions

implicit-0.5.2-cp310-cp310-win_amd64.whl (629.2 kB view details)

Uploaded CPython 3.10 Windows x86-64

implicit-0.5.2-cp310-cp310-manylinux2014_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.10

implicit-0.5.2-cp310-cp310-macosx_10_9_x86_64.whl (713.0 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

implicit-0.5.2-cp39-cp39-win_amd64.whl (629.2 kB view details)

Uploaded CPython 3.9 Windows x86-64

implicit-0.5.2-cp39-cp39-manylinux2014_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.9

implicit-0.5.2-cp39-cp39-macosx_10_9_x86_64.whl (713.0 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

implicit-0.5.2-cp38-cp38-win_amd64.whl (628.4 kB view details)

Uploaded CPython 3.8 Windows x86-64

implicit-0.5.2-cp38-cp38-manylinux2014_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.8

implicit-0.5.2-cp38-cp38-macosx_10_9_x86_64.whl (691.8 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

implicit-0.5.2-cp37-cp37m-win_amd64.whl (615.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

implicit-0.5.2-cp37-cp37m-manylinux2014_x86_64.whl (18.5 MB view details)

Uploaded CPython 3.7m

implicit-0.5.2-cp37-cp37m-macosx_10_9_x86_64.whl (688.3 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

implicit-0.5.2-cp36-cp36m-win_amd64.whl (615.4 kB view details)

Uploaded CPython 3.6m Windows x86-64

implicit-0.5.2-cp36-cp36m-manylinux2014_x86_64.whl (18.6 MB view details)

Uploaded CPython 3.6m

implicit-0.5.2-cp36-cp36m-macosx_10_9_x86_64.whl (686.6 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

File details

Details for the file implicit-0.5.2.tar.gz.

File metadata

  • Download URL: implicit-0.5.2.tar.gz
  • Upload date:
  • Size: 71.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2.tar.gz
Algorithm Hash digest
SHA256 bf4674a898251d89dd54d8a11a82f488edcc2ff2a9923a37dd0b271453e417d9
MD5 24825a1819372a9a448142d2ed209ac1
BLAKE2b-256 61e85969e085832411ef837daae148a3f6c8228558cff5cf542813abb989dd7c

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 629.2 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e44b543d8b457a84e2927e8bd4329f48b3214c7e21faee55778ce1697c15dc55
MD5 34973f3339cb03ce67a6dc38351bebab
BLAKE2b-256 708570d797322055d8754ac2cdd6e2fa30b5cb7b77873ccdbf368ecfd16ac02e

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp310-cp310-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 18.6 MB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fa07038cc45a53ef40a39d800eabb6df84dfbed43cccc5f842368a5ac0b14944
MD5 d3fc18b12b542ac593493e7c7f520994
BLAKE2b-256 3a5ea04cf6690921f8c5dd939132722f8e84e473785018126a8235d2d2474563

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp310-cp310-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 713.0 kB
  • Tags: CPython 3.10, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b07c02cec5da99f0f651a1b461e733ec37b11bc1c90c5ff239d392b0b3756f25
MD5 b0245bfcc3d7d9f2444cc17b1e72e6a0
BLAKE2b-256 c7b832c5e06efa338a0f15f18912605611b62d85566b1b48f4d4ad830ceeb0fc

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 629.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b57570a7f342be26726c047416458500e97e6bf5603859f21464a5942d6c5b5f
MD5 bef8d238e6045a1ddbb9fbd679a57427
BLAKE2b-256 0561e9869f521979cfd6ae20d761f5462ef6756d6e86db74a66d7f8d27f00155

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp39-cp39-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 18.6 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a72ea43e22709461d11a3993209a8115c57102ff2bd5aaf74fd35fa2ba3136dd
MD5 e2df2e26c40144b3340f4437a238e0f7
BLAKE2b-256 cfa3bfc623e7d935224fe61c7b98df2bde1bb19265291fe254a5d96b6927cb39

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 713.0 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 fb1ca462ac4ddf90c1f684f11ed6da6f644c707b582171ea068867a7428370ac
MD5 15f0eb7b1f81006f594e9de87299bf60
BLAKE2b-256 2b62f9789ea9917bf2dc94d2f2509488e0ce00283e61254e284344e1620e9603

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 628.4 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 9bb36f7a7462a2609ff65366299005ab61d6fada42a7f844ce443924adff1f89
MD5 9bcc82a8a95a9690a5554b92f6c3b878
BLAKE2b-256 4a55c388dfb8dddf33251028be44ca08803210a9d5ecbb90ecc6a2dc2c50a1e8

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 18.6 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 55bce1fbced5241814f23135e1cd5de0ba76e269e55c780c4a5707d542933c3d
MD5 c1377c0ee73f3c3fca17be75ca5ac4e5
BLAKE2b-256 8a0705015330499097b53960daf2b840262aa4d76160014c7bad3c9a1c0f9294

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 691.8 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 061dba73a45e01d3d586030fa0e680d27fd47bc9dc255db2cbbf6b08389e2aeb
MD5 124a8bf2a1cccf6862798bf3b6ca9ef2
BLAKE2b-256 d02c73393ca48acff9d22c34c05dabd0aaa7fa483bb1aec04337c6cac3d10cbd

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 615.3 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 b22ad6fd1684c0b46f98a7a706d0a8a69d838c0b65669b3bc5434198982abbec
MD5 4af12759e33c2a35c63ae2b45dcc07e3
BLAKE2b-256 bf9a126374e11fb559f0c7a3c8ff536ad7d5b76596a3c8a2d2ca446623359931

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp37-cp37m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 18.5 MB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c8a86c38e60d2128f0f2f48ddeedbe77aa344c5b4dc79eea3c4b24b791c3f3cc
MD5 b279071edc710b4cf93123dd7544cc30
BLAKE2b-256 ace07c522f634603f5d494c8056e46c53d0991414b959e3ecac5029ea9ca6071

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 688.3 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 75cda658a890abd0be30d26cf01649bb5242756032e721a29641fde9b949ace0
MD5 0a2e33cff27979f80d415f85a41ebfc9
BLAKE2b-256 b0faad1c72ed091a248964f71762b9b7059abf47993bf6ba5831721dfd55251a

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 615.4 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 3b9a7a199504818fcebe27a1382f2c02afb49daa413fe19f2f0f74fb18e30915
MD5 66e0fe7657b539e472cd1d70c65f33e4
BLAKE2b-256 05f6fbde693bd301b05d6a4de4192aab6729213d044016c93aed5892fee42924

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp36-cp36m-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 18.6 MB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4d2f769933748bff5824003d66167e443a96d997e606c200836cb790e3207efc
MD5 89459452f40cc92f952652840041801c
BLAKE2b-256 b2b1e52df466bc88bc5fd35f9519c31b85bbd0a915a970beaa6391ff8d016d0c

See more details on using hashes here.

File details

Details for the file implicit-0.5.2-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: implicit-0.5.2-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 686.6 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for implicit-0.5.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d707f494d6982944e61c6adc0e07617bf849b8167c5cfd87720e2ef143e604a5
MD5 625527f650d8ee482351ccb0771e7c84
BLAKE2b-256 bc26807d9993b9ec2185bb453241e6ba4a5195b479ba2589957d478d9f5c807f

See more details on using hashes here.

Supported by

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