Implicit
=======
[![Build
Status](https://github.com/benfred/implicit/workflows/Build/badge.svg)](https://github.com/benfred/implicit/actions?query=workflow%3ABuild+branch%3Amain)
[![Documentation](https://img.shields.io/badge/documentation-blue.svg)](https://benfred.github.io/implicit/)
Fast Python Collaborative Filtering for Implicit Datasets.
This project provides fast Python implementations of several different popular recommendation algorithms for
implicit feedback datasets:
* Alternating Least Squares as described in the papers [Collaborative Filtering for Implicit Feedback Datasets](http://yifanhu.net/PUB/cf.pdf) and [Applications of the Conjugate Gradient Method for Implicit
Feedback Collaborative Filtering](https://pdfs.semanticscholar.org/bfdf/7af6cf7fd7bb5e6b6db5bbd91be11597eaf0.pdf).
* [Bayesian Personalized Ranking](https://arxiv.org/pdf/1205.2618.pdf).
* [Logistic Matrix Factorization](https://web.stanford.edu/~rezab/nips2014workshop/submits/logmat.pdf)
* Item-Item Nearest Neighbour models using Cosine, TFIDF or BM25 as a distance metric.
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](https://github.com/spotify/annoy), [NMSLIB](https://github.com/searchivarius/nmslib)
and [Faiss](https://github.com/facebookresearch/faiss) can also be used by Implicit to [speed up
making recommendations](https://www.benfrederickson.com/approximate-nearest-neighbours-for-recommender-systems/).
#### 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
```python
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](https://github.com/benfred/implicit/blob/master/examples/lastfm.py).
For more information see the [documentation](https://benfred.github.io/implicit/).
#### Articles about Implicit
These blog posts describe the algorithms that power this library:
* [Finding Similar Music with Matrix Factorization](https://www.benfrederickson.com/matrix-factorization/)
* [Faster Implicit Matrix Factorization](https://www.benfrederickson.com/fast-implicit-matrix-factorization/)
* [Implicit Matrix Factorization on the GPU](https://www.benfrederickson.com/implicit-matrix-factorization-on-the-gpu/)
* [Approximate Nearest Neighbours for Recommender Systems](https://www.benfrederickson.com/approximate-nearest-neighbours-for-recommender-systems/)
* [Distance Metrics for Fun and Profit](https://www.benfrederickson.com/distance-metrics/)
There are also several other articles about using Implicit to build recommendation systems:
* [H&M Personalized Fashion Recommendations Kaggle Competition](https://www.kaggle.com/competitions/h-and-m-personalized-fashion-recommendations/discussion/324129)
* [Yandex Cup 2022: Like Prediction](https://github.com/greenwolf-nsk/yandex-cup-2022-recsys)
* [Recommending GitHub Repositories with Google BigQuery and the implicit library](https://medium.com/@jbochi/recommending-github-repositories-with-google-bigquery-and-the-implicit-library-e6cce666c77)
* [Intro to Implicit Matrix Factorization: Classic ALS with Sketchfab Models](http://blog.ethanrosenthal.com/2016/10/19/implicit-mf-part-1/)
* [A Gentle Introduction to Recommender Systems with Implicit Feedback](https://jessesw.com/Rec-System/).
#### 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](https://developer.nvidia.com/cuda-downloads).
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](https://github.com/benfred/implicit/tree/master/benchmarks).
#### 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
Raw data
{
"_id": null,
"home_page": "http://github.com/benfred/implicit/",
"name": "wbimplicit",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "Matrix Factorization,Implicit Alternating Least Squares,Collaborative Filtering,Recommender Systems",
"author": "Ben Frederickson",
"author_email": "ben@benfrederickson.com",
"download_url": "https://files.pythonhosted.org/packages/09/ae/8936408b30f63e4ff734a9a2e96b1abe59205dc808c38de8e3aeb35b57df/wbimplicit-0.6.2.1.tar.gz",
"platform": null,
"description": "Implicit\n=======\n\n[![Build\nStatus](https://github.com/benfred/implicit/workflows/Build/badge.svg)](https://github.com/benfred/implicit/actions?query=workflow%3ABuild+branch%3Amain)\n[![Documentation](https://img.shields.io/badge/documentation-blue.svg)](https://benfred.github.io/implicit/)\n\n\nFast Python Collaborative Filtering for Implicit Datasets.\n\nThis project provides fast Python implementations of several different popular recommendation algorithms for\nimplicit feedback datasets:\n\n * Alternating Least Squares as described in the papers [Collaborative Filtering for Implicit Feedback Datasets](http://yifanhu.net/PUB/cf.pdf) and [Applications of the Conjugate Gradient Method for Implicit\nFeedback Collaborative Filtering](https://pdfs.semanticscholar.org/bfdf/7af6cf7fd7bb5e6b6db5bbd91be11597eaf0.pdf).\n\n * [Bayesian Personalized Ranking](https://arxiv.org/pdf/1205.2618.pdf).\n\n * [Logistic Matrix Factorization](https://web.stanford.edu/~rezab/nips2014workshop/submits/logmat.pdf)\n\n * Item-Item Nearest Neighbour models using Cosine, TFIDF or BM25 as a distance metric.\n\nAll models have multi-threaded training routines, using Cython and OpenMP to fit the models in\nparallel among all available CPU cores. In addition, the ALS and BPR models both have custom CUDA\nkernels - enabling fitting on compatible GPU's. Approximate nearest neighbours libraries such as [Annoy](https://github.com/spotify/annoy), [NMSLIB](https://github.com/searchivarius/nmslib)\nand [Faiss](https://github.com/facebookresearch/faiss) can also be used by Implicit to [speed up\nmaking recommendations](https://www.benfrederickson.com/approximate-nearest-neighbours-for-recommender-systems/).\n\n#### Installation\n\nImplicit can be installed from pypi with:\n\n```\npip install implicit\n```\n\nInstalling with pip will use prebuilt binary wheels on x86_64 Linux, Windows\nand OSX. These wheels include GPU support on Linux.\n\nImplicit can also be installed with conda:\n\n```\n# CPU only package\nconda install -c conda-forge implicit\n\n# CPU+GPU package\nconda install -c conda-forge implicit implicit-proc=*=gpu\n```\n\n#### Basic Usage\n\n```python\nimport implicit\n\n# initialize a model\nmodel = implicit.als.AlternatingLeastSquares(factors=50)\n\n# train the model on a sparse matrix of user/item/confidence weights\nmodel.fit(user_item_data)\n\n# recommend items for a user\nrecommendations = model.recommend(userid, user_item_data[userid])\n\n# find related items\nrelated = model.similar_items(itemid)\n```\n\nThe examples folder has a program showing how to use this to [compute similar artists on the\nlast.fm dataset](https://github.com/benfred/implicit/blob/master/examples/lastfm.py).\n\nFor more information see the [documentation](https://benfred.github.io/implicit/).\n\n#### Articles about Implicit\n\nThese blog posts describe the algorithms that power this library:\n\n * [Finding Similar Music with Matrix Factorization](https://www.benfrederickson.com/matrix-factorization/)\n * [Faster Implicit Matrix Factorization](https://www.benfrederickson.com/fast-implicit-matrix-factorization/)\n * [Implicit Matrix Factorization on the GPU](https://www.benfrederickson.com/implicit-matrix-factorization-on-the-gpu/)\n * [Approximate Nearest Neighbours for Recommender Systems](https://www.benfrederickson.com/approximate-nearest-neighbours-for-recommender-systems/)\n * [Distance Metrics for Fun and Profit](https://www.benfrederickson.com/distance-metrics/)\n\nThere are also several other articles about using Implicit to build recommendation systems:\n * [H&M Personalized Fashion Recommendations Kaggle Competition](https://www.kaggle.com/competitions/h-and-m-personalized-fashion-recommendations/discussion/324129)\n * [Yandex Cup 2022: Like Prediction](https://github.com/greenwolf-nsk/yandex-cup-2022-recsys)\n * [Recommending GitHub Repositories with Google BigQuery and the implicit library](https://medium.com/@jbochi/recommending-github-repositories-with-google-bigquery-and-the-implicit-library-e6cce666c77)\n * [Intro to Implicit Matrix Factorization: Classic ALS with Sketchfab Models](http://blog.ethanrosenthal.com/2016/10/19/implicit-mf-part-1/)\n * [A Gentle Introduction to Recommender Systems with Implicit Feedback](https://jessesw.com/Rec-System/).\n\n\n#### Requirements\n\nThis library requires SciPy version 0.16 or later and Python version 3.6 or later.\n\nGPU Support requires at least version 11 of the [NVidia CUDA Toolkit](https://developer.nvidia.com/cuda-downloads).\n\nThis library is tested with Python 3.7, 3.8, 3.9, 3.10 and 3.11 on Ubuntu, OSX and Windows.\n\n#### Benchmarks\n\nSimple benchmarks comparing the ALS fitting time versus [Spark can be found here](https://github.com/benfred/implicit/tree/master/benchmarks).\n\n#### Optimal Configuration\n\nI'd recommend configuring SciPy to use Intel's MKL matrix libraries. One easy way of doing this is by installing the Anaconda Python distribution.\n\nFor systems using OpenBLAS, I highly recommend setting 'export OPENBLAS_NUM_THREADS=1'. This\ndisables its internal multithreading ability, which leads to substantial speedups for this\npackage. Likewise for Intel MKL, setting 'export MKL_NUM_THREADS=1' should also be set.\n\nReleased under the MIT License\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Collaborative Filtering for Implicit Feedback Datasets",
"version": "0.6.2.1",
"project_urls": {
"Homepage": "http://github.com/benfred/implicit/"
},
"split_keywords": [
"matrix factorization",
"implicit alternating least squares",
"collaborative filtering",
"recommender systems"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4c2a39f4be007592a400e2dcd37087cee47e48e8717f0291d359878c90af5f48",
"md5": "111cc837b4621029240f3d4e44461076",
"sha256": "4257e9ad57cc34e85afd52c6e6e8c62b6c6f935998aa74c357be88959916a68a"
},
"downloads": -1,
"filename": "wbimplicit-0.6.2.1-cp310-cp310-manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "111cc837b4621029240f3d4e44461076",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 886715,
"upload_time": "2023-06-10T16:05:10",
"upload_time_iso_8601": "2023-06-10T16:05:10.184712Z",
"url": "https://files.pythonhosted.org/packages/4c/2a/39f4be007592a400e2dcd37087cee47e48e8717f0291d359878c90af5f48/wbimplicit-0.6.2.1-cp310-cp310-manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bfc35bef55da55a656484978dd934f5c65a12f31bc1dc970d636fb765af090ca",
"md5": "edb0e0f4ade654dbc37e03a429674d66",
"sha256": "4e65ed70d6dd96905d82dd23df7c6b1a7dd8e78bf38917073ab292928f452084"
},
"downloads": -1,
"filename": "wbimplicit-0.6.2.1-cp310-cp310-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "edb0e0f4ade654dbc37e03a429674d66",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": null,
"size": 9178832,
"upload_time": "2023-06-10T16:05:14",
"upload_time_iso_8601": "2023-06-10T16:05:14.155946Z",
"url": "https://files.pythonhosted.org/packages/bf/c3/5bef55da55a656484978dd934f5c65a12f31bc1dc970d636fb765af090ca/wbimplicit-0.6.2.1-cp310-cp310-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2043728aa44fbbb0ab05db771d3ee68f7b4baea3c0d7447211d7e8a1f4d757f8",
"md5": "3db1436d710dea8ba85f7323e69f2106",
"sha256": "c5b383acfbab19d86ef4304ea09106b0fa2498f54f06f3b19e349e73da59080c"
},
"downloads": -1,
"filename": "wbimplicit-0.6.2.1-cp311-cp311-manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "3db1436d710dea8ba85f7323e69f2106",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": null,
"size": 885221,
"upload_time": "2023-06-10T16:05:17",
"upload_time_iso_8601": "2023-06-10T16:05:17.823558Z",
"url": "https://files.pythonhosted.org/packages/20/43/728aa44fbbb0ab05db771d3ee68f7b4baea3c0d7447211d7e8a1f4d757f8/wbimplicit-0.6.2.1-cp311-cp311-manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8f08ef2ebf62382776c9c9f40bc4d146f4ed9e3399d673aa3fd7d2af27edd5d6",
"md5": "d836475e3ea313360e9520b46f961fd9",
"sha256": "c689d5d16b0a5ffd5ee316fb1a565b6f9bff3624d173a1b65345e5ff3c026b7b"
},
"downloads": -1,
"filename": "wbimplicit-0.6.2.1-cp311-cp311-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "d836475e3ea313360e9520b46f961fd9",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": null,
"size": 9191235,
"upload_time": "2023-06-10T16:05:20",
"upload_time_iso_8601": "2023-06-10T16:05:20.583685Z",
"url": "https://files.pythonhosted.org/packages/8f/08/ef2ebf62382776c9c9f40bc4d146f4ed9e3399d673aa3fd7d2af27edd5d6/wbimplicit-0.6.2.1-cp311-cp311-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "54d483f0876a42c1df42cc9ee26811f382badba0330c013ec778ffafc765fb86",
"md5": "0bccb6fbb4895f9a57913f5fe314a948",
"sha256": "d131cbea7c0a963fc35c41be93ecd0e02301ab2620fbcded8aefc6df7fa4a044"
},
"downloads": -1,
"filename": "wbimplicit-0.6.2.1-cp39-cp39-manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "0bccb6fbb4895f9a57913f5fe314a948",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 900336,
"upload_time": "2023-06-10T16:05:23",
"upload_time_iso_8601": "2023-06-10T16:05:23.344235Z",
"url": "https://files.pythonhosted.org/packages/54/d4/83f0876a42c1df42cc9ee26811f382badba0330c013ec778ffafc765fb86/wbimplicit-0.6.2.1-cp39-cp39-manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b0b2a595c6bf7f6a2664c99b648a623814b01b775dbc00a5784d9f2b285eb247",
"md5": "a68c442fc275a3a62017debe54e74b3f",
"sha256": "ee023b7e112a1dc44a4bb5b1ff9e866eb1ef9688d3d33192dd5c87a174860815"
},
"downloads": -1,
"filename": "wbimplicit-0.6.2.1-cp39-cp39-manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "a68c442fc275a3a62017debe54e74b3f",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": null,
"size": 9197799,
"upload_time": "2023-06-10T16:05:25",
"upload_time_iso_8601": "2023-06-10T16:05:25.874212Z",
"url": "https://files.pythonhosted.org/packages/b0/b2/a595c6bf7f6a2664c99b648a623814b01b775dbc00a5784d9f2b285eb247/wbimplicit-0.6.2.1-cp39-cp39-manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "09ae8936408b30f63e4ff734a9a2e96b1abe59205dc808c38de8e3aeb35b57df",
"md5": "348ed36a874a397d7c7abdc48dd0c95e",
"sha256": "d03d79a1ec968786b5828069a50cecc3ac633668df07e504aebf5e2b88878757"
},
"downloads": -1,
"filename": "wbimplicit-0.6.2.1.tar.gz",
"has_sig": false,
"md5_digest": "348ed36a874a397d7c7abdc48dd0c95e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 69878,
"upload_time": "2023-06-10T16:05:31",
"upload_time_iso_8601": "2023-06-10T16:05:31.538833Z",
"url": "https://files.pythonhosted.org/packages/09/ae/8936408b30f63e4ff734a9a2e96b1abe59205dc808c38de8e3aeb35b57df/wbimplicit-0.6.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-10 16:05:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "benfred",
"github_project": "implicit",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "wbimplicit"
}