lenskit

Python recommendation toolkit

https://github.com/lenskit/lkpy

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 4 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
    6 of 16 committers (37.5%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.5%) to scientific vocabulary

Keywords

lenskit python recsys scikit

Keywords from Contributors

interactive particle mesh interpretability sequences generic projection optim embedded hacking
Last synced: 6 months ago · JSON representation ·

Repository

Python recommendation toolkit

Basic Info
  • Host: GitHub
  • Owner: lenskit
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage: https://lkpy.lenskit.org
  • Size: 11.1 MB
Statistics
  • Stars: 299
  • Watchers: 6
  • Forks: 72
  • Open Issues: 81
  • Releases: 54
Topics
lenskit python recsys scikit
Created over 7 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

Python recommendation tools

Automatic Tests codecov Scientific Python Ecosystem Coordination PyPI - Version Conda Version

LensKit is a set of Python tools for experimenting with and studying recommender systems. It provides support for training, running, and evaluating recommender algorithms in a flexible fashion suitable for research and education.

LensKit for Python (LKPY) is the successor to the Java-based LensKit project.

[!IMPORTANT] If you use LensKit for Python in published research, please cite:

Michael D. Ekstrand. 2020. LensKit for Python: Next-Generation Software for Recommender Systems Experiments. In Proceedings of the 29th ACM International Conference on Information and Knowledge Management (CIKM '20). DOI:10.1145/3340531.3412778. arXiv:1809.03125 [cs.IR].

[!NOTE]

LensKit had significant changes in the 2025.1 release. See the Migration Guide for details.

Installing

To install the current release with uv (recommended):

console $ uv pip install lenskit

Or, to add it to your project's dependencies and virtual environment:

console $ uv add lenskit

Classic pip also works:

console $ python -m pip install lenskit

Then see Getting Started

Conda Packages

You can also install LensKit from conda-forge with pixi:

console $ pixi add lenskit

Or conda:

console $ conda install -c conda-forge lenskit

Development Version

To use the latest development version, you have two options. You can install directly from GitHub:

console $ uv pip install -U git+https://github.com/lenskit/lkpy

Or you can use our PyPI index, by adding to pyproject.toml:

toml [[tool.uv.index]] name = "lenskit" url = "https://pypi.lenskit.org/lenskit-dev/"

Binary wheels of LensKit development (and release) versions are automatically pushed to this index, although they are not guaranteed to be permanently available. Reproducible code should generally depend on released versions published to PyPI.

Simplifying PyTorch installation

We also provide mirrors of the PyTorch package repositories that are filtered to only include PyTorch and directly supporting dependencies, without other packages that conflict with or mask packages from PyPI, and with fallbacks for other platforms (i.e., our CUDA indices include CPU-only MacOS packages). This makes it easier to install specific versions of PyTorch in your project with the index priority and fallthrough logic implemented by uv. To make your project only use CPU-based PyTorch, you can add to pyproject.toml:

toml [[tool.uv.index]] name = "torch-cpu" url = "https://pypi.lenskit.org/torch/cpu/"

Or CUDA 12.8:

toml [[tool.uv.index]] name = "torch-gpu" url = "https://pypi.lenskit.org/torch/cu128/"

These indices provide the same package distributions as the official PyTorch repositories (in fact, they link directly to the PyTorch packages). They are just an alternate index view that reduces some package conflicts.

Developing

To contribute to LensKit, clone or fork the repository, get to work, and submit a pull request. We welcome contributions from anyone; if you are looking for a place to get started, see the issue tracker.

Our development workflow is documented in the wiki; the wiki also contains other information on developing LensKit. User-facing documentation is at https://lkpy.lenskit.org.

We use uv for developing LensKit and managing development environments. Our pyproject.toml file contains the Python development dependencies; you also need a working Rust compiler (typically via rustup). Before setting up to work on LensKit, you therefore need:

  • Git
  • uv
  • rustup and a working Rust compiler (rustup install stable)
  • A working C compiler compatible with Python
    • On Windows, this is either Visual Studio (with C++ development) or the Visual C++ Build Tools. See the Rustup Windows install instructions for details.
    • On Mac, install Xcode.
    • On Linux, see your system package manager instructions.
Windows On Windows, you can install dependencies (except for the Visual C++ tools) with `winget`: ```console > winget install Git.Git astral-sh.uv Rustlang.Rustup > rustup install stable-msvc ```
Mac On Mac, you can install the dependencies with Homebrew: ```console $ brew install git uv rustup ```

Once you have the dependencies installed, set up your LensKit development environment:

console $ uv venv -p 3.12 $ uv sync

If you want all extras (may not work on Windows), do:

console $ uv sync --all-extras

You can then activate the virtual environment to have the tools available and run tools like pytest:

console $ . ./.venv/bin/activate

Testing Changes

You should always test your changes by running the LensKit test suite:

pytest tests

If you want to use your changes in a LensKit experiment, you can locally install your modified LensKit into your experiment's environment. We recommend using separate environments for LensKit development and for each experiment; you will need to install the modified LensKit into your experiment's repository:

uv pip install -e /path/to/lkpy

Resources

Acknowledgements

This material is based upon work supported by the National Science Foundation under Grant No. IIS 17-51278. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.

Owner

  • Name: LensKit
  • Login: lenskit
  • Kind: organization

Developing the LensKit recommender systems toolkit.

Citation (CITATION.cff)

# YAML 1.2
---
authors:
  -
    family-names: Ekstrand
    given-names: "Michael D."
    orcid: "https://orcid.org/0000-0003-2467-0108"
cff-version: "1.2.0"
license: MIT
message: "If you use this software, please cite the CIKM paper in 'preferred-citation'."
title: "LensKit for Python"
version: "0.14.0"
preferred-citation:
- type: conference-paper
  authors:
  - family-names: Ekstrand
    given-names: "Michael D."
  title: "LensKit for Python: Next-Generation Software for Recommender Systems Experiments"
  collection-title: "Proceedings of the 29th ACM International Conference on Information and Knowledge Management"
  conference: "CIKM '20"
  doi: "10.1145/3340531.3412778"
  start: 2999
  end: 3006
  abstract: >
    LensKit is an open-source toolkit for building, researching, and learning about recommender systems. First released in 2010 as a Java framework, it has supported diverse published research, small-scale production deployments, and education in both MOOC and traditional classroom settings. In this paper, I present the next generation of the LensKit project, re-envisioning the original tool's objectives as flexible Python package for supporting recommender systems research and development. LensKit for Python (LKPY) enables researchers and students to build robust, flexible, and reproducible experiments that make use of the large and growing PyData and Scientific Python ecosystem, including scikit-learn, TensorFlow, and PyTorch. To that end, it provides classical collaborative filtering implementations, recommender system evaluation metrics, data preparation routines, and tools for efficiently batch running recommendation algorithms, all usable in any combination with each other or with other Python software.

    This paper describes the design goals, use cases, and capabilities of LKPY, contextualized in a reflection on the successes and failures of the original LensKit for Java software.
...

GitHub Events

Total
  • Create event: 50
  • Release event: 30
  • Issues event: 148
  • Watch event: 33
  • Delete event: 21
  • Issue comment event: 286
  • Push event: 340
  • Pull request review comment event: 65
  • Pull request review event: 37
  • Gollum event: 3
  • Pull request event: 424
  • Fork event: 13
Last Year
  • Create event: 50
  • Release event: 30
  • Issues event: 148
  • Watch event: 33
  • Delete event: 21
  • Issue comment event: 286
  • Push event: 340
  • Pull request review comment event: 65
  • Pull request review event: 37
  • Gollum event: 3
  • Pull request event: 424
  • Fork event: 13

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 3,686
  • Total Committers: 16
  • Avg Commits per committer: 230.375
  • Development Distribution Score (DDS): 0.526
Past Year
  • Commits: 1,375
  • Committers: 5
  • Avg Commits per committer: 275.0
  • Development Distribution Score (DDS): 0.387
Top Committers
Name Email Commits
Michael Ekstrand md@e****t 1,747
Michael Ekstrand m****d@b****u 944
Michael Ekstrand m****d@d****u 896
Carlos c****s@C****l 36
Carlos c****s@c****u 23
Adam Keener k****1@g****m 16
Justin Reppert j****t@g****m 7
MucunTian t****n@g****m 5
Lukas Wegmeth l****h@u****e 3
Michael Ekstrand m****d@m****u 2
Ziyao Wei z****y@g****m 2
Shwetanshu Singh s****h@n****u 1
TJ Murphy t****y@g****m 1
Ziyao Wei z****o@g****v 1
azure-pipelines[bot] a****] 1
dependabot[bot] 4****] 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 206
  • Total pull requests: 687
  • Average time to close issues: 6 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 13
  • Total pull request authors: 14
  • Average comments per issue: 0.51
  • Average comments per pull request: 1.08
  • Merged pull requests: 611
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 102
  • Pull requests: 453
  • Average time to close issues: 16 days
  • Average time to close pull requests: 1 day
  • Issue authors: 4
  • Pull request authors: 11
  • Average comments per issue: 0.21
  • Average comments per pull request: 1.03
  • Merged pull requests: 399
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • mdekstrand (189)
  • david-cortes (5)
  • SavvinaDaniil (2)
  • skilfullycurled (1)
  • ZiyaoWei (1)
  • rawls238 (1)
  • spawliko (1)
  • rburke2233 (1)
  • JacobMaciejewski (1)
  • RohanKarthikeyan (1)
  • julioasotodv (1)
  • DataScienceUWL (1)
  • johnnyk1090 (1)
Pull Request Authors
  • mdekstrand (649)
  • danhdanhtuan0308 (10)
  • ZiyaoWei (5)
  • FroggoLight (4)
  • vibhor-5 (3)
  • sushobhan2024 (3)
  • cakiki (2)
  • lukas-wegmeth (2)
  • samiravaez (2)
  • albus-droid (2)
  • aisa6148 (2)
  • ywcharles (1)
  • keener101 (1)
  • sherif-med (1)
Top Labels
Issue Labels
components (42) evaluation (41) data (27) enhancement (12) docs (11) algorithms (11) batch (11) pipeline (11) internals (10) performance (10) build (8) idea (4) good first issue (4) dependencies (3) breaking (2) cli (1) bug (1) maybe (1) wontfix (1)
Pull Request Labels
build (131) internals (111) data (106) components (72) pipeline (62) evaluation (61) docs (53) algorithms (44) performance (37) dependencies (31) bug (21) batch (17) enhancement (17) cli (14) breaking (2)

Packages

  • Total packages: 6
  • Total downloads:
    • pypi 4,263 last-month
  • Total dependent packages: 4
    (may contain duplicates)
  • Total dependent repositories: 12
    (may contain duplicates)
  • Total versions: 138
  • Total maintainers: 1
pypi.org: lenskit

Toolkit for recommender systems research, teaching, and more.

  • Documentation: https://lenskit.readthedocs.io/
  • License: Copyright (c) 2018–2023 Boise State University Copyright (c) 2023-2024 Drexel University and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 2025.2.0
    published 12 months ago
  • Versions: 52
  • Dependent Packages: 2
  • Dependent Repositories: 9
  • Downloads: 4,137 Last month
Rankings
Dependent packages count: 3.1%
Dependent repos count: 4.9%
Average: 4.9%
Downloads: 6.8%
Maintainers (1)
Last synced: 6 months ago
pypi.org: lenskit-sklearn
  • Documentation: https://lenskit-sklearn.readthedocs.io/
  • License: Copyright (c) 2018–2023 Boise State University Copyright (c) 2023-2024 Drexel University and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 2025.1.1
    published 12 months ago
  • Versions: 18
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 21 Last month
Rankings
Stargazers count: 5.4%
Forks count: 6.8%
Dependent packages count: 9.8%
Average: 19.3%
Dependent repos count: 55.3%
Maintainers (1)
Last synced: 6 months ago
pypi.org: lenskit-hpf
  • Documentation: https://lenskit-hpf.readthedocs.io/
  • License: Copyright (c) 2018–2023 Boise State University Copyright (c) 2023-2024 Drexel University and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 2025.1.1
    published 12 months ago
  • Versions: 20
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 38 Last month
Rankings
Dependent packages count: 10.0%
Dependent repos count: 21.7%
Average: 27.7%
Downloads: 51.3%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: lenskit

LensKit is an open-source toolkit for building, researching, and learning about recommender systems.

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 2
Rankings
Dependent repos count: 20.1%
Forks count: 23.9%
Stargazers count: 24.8%
Average: 30.1%
Dependent packages count: 51.6%
Last synced: 6 months ago
pypi.org: lenskit-funksvd

FunkSVD recommendation model for LensKit.

  • Documentation: https://lenskit-funksvd.readthedocs.io/
  • License: Copyright (c) 2018–2023 Boise State University Copyright (c) 2023-2024 Drexel University and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 2025.1.1
    published 12 months ago
  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 29 Last month
Rankings
Dependent packages count: 9.8%
Average: 32.6%
Dependent repos count: 55.4%
Maintainers (1)
Last synced: 6 months ago
pypi.org: lenskit-implicit
  • Documentation: https://lenskit-implicit.readthedocs.io/
  • License: Copyright (c) 2018–2023 Boise State University Copyright (c) 2023-2024 Drexel University and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > The above copyright notice and this permission notice shall be included in > all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 2025.1.1
    published 12 months ago
  • Versions: 20
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 38 Last month
Rankings
Dependent packages count: 9.8%
Average: 38.8%
Dependent repos count: 67.9%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/build-packages.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • actions/upload-artifact v1 composite
.github/workflows/release-drafter.yml actions
  • release-drafter/release-drafter v5 composite
.github/workflows/test-suite.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v1 composite
  • lenskit/lkbuild/actions/report-test-results main composite
  • lenskit/lkbuild/actions/save-test-results main composite
  • lenskit/lkbuild/actions/setup-conda-env main composite
  • lenskit/lkbuild/actions/setup-vanilla-env main composite
pyproject.toml pypi
  • binpickle >= 0.3.2
  • cffi >= 1.12.2
  • csr >= 0.4
  • numba >= 0.51, < 0.57
  • numpy >= 1.19
  • pandas >=1.0, ==1.*
  • psutil >= 5
  • scipy >= 1.3.2
  • seedbank >= 0.1.0