{"id":13398269,"url":"https://github.com/lyst/lightfm","last_synced_at":"2025-05-13T16:12:18.941Z","repository":{"id":35664922,"uuid":"39940111","full_name":"lyst/lightfm","owner":"lyst","description":"A Python implementation of LightFM, a hybrid recommendation algorithm.","archived":false,"fork":false,"pushed_at":"2024-07-24T18:48:54.000Z","size":8085,"stargazers_count":4904,"open_issues_count":160,"forks_count":701,"subscribers_count":84,"default_branch":"master","last_synced_at":"2025-04-23T20:58:10.447Z","etag":null,"topics":["learning-to-rank","machine-learning","matrix-factorization","python","recommender","recommender-system"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lyst.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":"2015-07-30T08:34:00.000Z","updated_at":"2025-04-23T16:03:12.000Z","dependencies_parsed_at":"2022-07-12T13:01:19.528Z","dependency_job_id":"2688a569-4604-4fb6-a89e-9943c688b9be","html_url":"https://github.com/lyst/lightfm","commit_stats":{"total_commits":304,"total_committers":47,"mean_commits":6.468085106382978,"dds":0.7138157894736843,"last_synced_commit":"688feded0717f289933b95a0134bad6fbe547331"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyst%2Flightfm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyst%2Flightfm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyst%2Flightfm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lyst%2Flightfm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lyst","download_url":"https://codeload.github.com/lyst/lightfm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250514767,"owners_count":21443208,"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":["learning-to-rank","machine-learning","matrix-factorization","python","recommender","recommender-system"],"created_at":"2024-07-30T19:00:21.485Z","updated_at":"2025-04-23T20:58:15.386Z","avatar_url":"https://github.com/lyst.png","language":"Python","readme":"# LightFM\n\n![LightFM logo](lightfm.png)\n\n| Build status | |\n|---|---|\n| Linux |[![Circle CI](https://circleci.com/gh/lyst/lightfm.svg?style=svg)](https://circleci.com/gh/lyst/lightfm)|\n| OSX (OpenMP disabled)|[![Travis CI](https://travis-ci.org/lyst/lightfm.svg?branch=master)](https://travis-ci.org/lyst/lightfm)|\n| Windows (OpenMP disabled) |[![Appveyor](https://ci.appveyor.com/api/projects/status/6cqpqb6969i1h4p7/branch/master?svg=true)](https://ci.appveyor.com/project/maciejkula/lightfm/branch/master)|\n\n[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/lightfm-rec/Lobby) [![PyPI](https://img.shields.io/pypi/v/lightfm.svg)](https://pypi.python.org/pypi/lightfm/)\n[![Anaconda-Server Badge](https://anaconda.org/conda-forge/lightfm/badges/version.svg)](https://anaconda.org/conda-forge/lightfm)\n\nLightFM is a Python implementation of a number of popular recommendation algorithms for both implicit and explicit feedback, including efficient implementation of BPR and WARP ranking losses. It's easy to use, fast (via multithreaded model estimation), and produces high quality results.\n\nIt also makes it possible to incorporate both item and user metadata into the traditional matrix factorization algorithms. It represents each user and item as the sum of the latent representations of their features, thus allowing recommendations to generalise to new items (via item features) and to new users (via user features).\n\nFor more details, see the [Documentation](http://lyst.github.io/lightfm/docs/home.html).\n\nNeed help? Contact me via [email](mailto:lightfm@zoho.com), [Twitter](https://twitter.com/Maciej_Kula), or [Gitter](https://gitter.im/lightfm-rec/Lobby).\n\n## Installation\nInstall from `pip`:\n```\npip install lightfm\n```\nor Conda:\n```\nconda install -c conda-forge lightfm\n```\n\n## Quickstart\nFitting an implicit feedback model on the MovieLens 100k dataset is very easy:\n```python\nfrom lightfm import LightFM\nfrom lightfm.datasets import fetch_movielens\nfrom lightfm.evaluation import precision_at_k\n\n# Load the MovieLens 100k dataset. Only five\n# star ratings are treated as positive.\ndata = fetch_movielens(min_rating=5.0)\n\n# Instantiate and train the model\nmodel = LightFM(loss='warp')\nmodel.fit(data['train'], epochs=30, num_threads=2)\n\n# Evaluate the trained model\ntest_precision = precision_at_k(model, data['test'], k=5).mean()\n```\n\n## Articles and tutorials on using LightFM\n1. [Learning to Rank Sketchfab Models with LightFM](http://blog.ethanrosenthal.com/2016/11/07/implicit-mf-part-2/)\n2. [Metadata Embeddings for User and Item Cold-start Recommendations](http://building-babylon.net/2016/01/26/metadata-embeddings-for-user-and-item-cold-start-recommendations/)\n3. [Recommendation Systems - Learn Python for Data Science](https://www.youtube.com/watch?v=9gBC9R-msAk)\n4. [Using LightFM to Recommend Projects to Consultants](https://medium.com/product-at-catalant-technologies/using-lightfm-to-recommend-projects-to-consultants-44084df7321c#.gu887ky51)\n\n## How to cite\nPlease cite LightFM if it helps your research. You can use the following BibTeX entry:\n```\n@inproceedings{DBLP:conf/recsys/Kula15,\n  author    = {Maciej Kula},\n  editor    = {Toine Bogers and\n               Marijn Koolen},\n  title     = {Metadata Embeddings for User and Item Cold-start Recommendations},\n  booktitle = {Proceedings of the 2nd Workshop on New Trends on Content-Based Recommender\n               Systems co-located with 9th {ACM} Conference on Recommender Systems\n               (RecSys 2015), Vienna, Austria, September 16-20, 2015.},\n  series    = {{CEUR} Workshop Proceedings},\n  volume    = {1448},\n  pages     = {14--21},\n  publisher = {CEUR-WS.org},\n  year      = {2015},\n  url       = {http://ceur-ws.org/Vol-1448/paper4.pdf},\n}\n```\n\n## Development\nPull requests are welcome. To install for development:\n\n1. Clone the repository: `git clone git@github.com:lyst/lightfm.git`\n2. Setup a virtual environment: `cd lightfm \u0026\u0026 python3 -m venv venv \u0026\u0026 source ./venv/bin/activate`\n3. Install it for development using pip: `pip install -e . \u0026\u0026 pip install -r test-requirements.txt`\n4. You can run tests by running `./venv/bin/py.test tests`.\n5. LightFM uses [black](https://github.com/ambv/black) to enforce code formatting and flake8 for linting, see `lint-requirements.txt`.\n6. [Optional]: You can install pre-commit to locally enfore formatting and linting. Install with:\n    ```bash\n    pip install pre-commit\n    pre-commit install\n    ```\n\nWhen making changes to the `.pyx` extension files, you'll need to run `python setup.py cythonize` in order to produce the extension `.c` files before running `pip install -e .`.\n","funding_links":[],"categories":["Recommender Systems","资源列表","5. GitHub Repositories","Python","Learning-to-Rank \u0026 Recommender Systems","Recommendation Systems","Recommendation, Advertisement \u0026 Ranking","推荐系统","推荐系统算法库与列表","Industry Strength RecSys","Recommender Systems [🔝](#readme)","Awesome Python","Recommendation","Feature Extraction","Libraries"],"sub_categories":["推荐系统","Others","网络服务_其他","Recommender Systems","Tools","Ranking/Recommender"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyst%2Flightfm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flyst%2Flightfm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyst%2Flightfm/lists"}