{"id":13486607,"url":"https://github.com/benfred/implicit","last_synced_at":"2025-05-13T19:09:00.080Z","repository":{"id":37381994,"uuid":"56417681","full_name":"benfred/implicit","owner":"benfred","description":"Fast Python Collaborative Filtering for Implicit Feedback Datasets","archived":false,"fork":false,"pushed_at":"2024-07-11T17:58:17.000Z","size":7873,"stargazers_count":3663,"open_issues_count":100,"forks_count":621,"subscribers_count":76,"default_branch":"main","last_synced_at":"2025-04-25T18:19:23.425Z","etag":null,"topics":["collaborative-filtering","machine-learning","matrix-factorization","recommendation","recommendation-system","recommender-system"],"latest_commit_sha":null,"homepage":"https://benfred.github.io/implicit/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benfred.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-17T03:45:23.000Z","updated_at":"2025-04-25T00:12:41.000Z","dependencies_parsed_at":"2024-04-28T01:56:35.441Z","dependency_job_id":"35baf86b-b748-4279-8c61-78997e6346e2","html_url":"https://github.com/benfred/implicit","commit_stats":{"total_commits":358,"total_committers":37,"mean_commits":9.675675675675675,"dds":"0.24581005586592175","last_synced_commit":"cb2a66d50d1f1c2779108724c78f7653024332b8"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benfred%2Fimplicit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benfred%2Fimplicit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benfred%2Fimplicit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benfred%2Fimplicit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benfred","download_url":"https://codeload.github.com/benfred/implicit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250869645,"owners_count":21500353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collaborative-filtering","machine-learning","matrix-factorization","recommendation","recommendation-system","recommender-system"],"created_at":"2024-07-31T18:00:48.981Z","updated_at":"2025-04-25T18:19:46.133Z","avatar_url":"https://github.com/benfred.png","language":"Python","readme":"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\u0026M 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","funding_links":[],"categories":["Recommender Systems","资源列表","Python","Recommendation, Advertisement \u0026 Ranking","推荐系统","Industry Strength RecSys","Recommender Systems [🔝](#readme)","Awesome Python","Recommendation","Feature Extraction"],"sub_categories":["推荐系统","Others","Recommender Systems","Tools","Ranking/Recommender"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenfred%2Fimplicit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenfred%2Fimplicit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenfred%2Fimplicit/lists"}