Skip to content
forked from lenskit/lkpy

Some Python recommendation tools (Michael's WIP fork, feature branches may be rebased)

License

Notifications You must be signed in to change notification settings

mdekstrand/lkpy

This branch is 239 commits behind lenskit/lkpy:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4a4dd46 · Apr 8, 2025
Mar 31, 2025
Mar 7, 2025
Mar 31, 2025
Jun 15, 2021
Apr 7, 2025
Apr 8, 2025
Apr 7, 2025
Feb 22, 2025
Oct 9, 2024
Sep 19, 2024
Mar 24, 2025
Mar 2, 2024
Jan 7, 2025
Jun 15, 2024
Jun 15, 2024
Mar 2, 2024
Mar 2, 2024
Apr 1, 2025
Jul 2, 2024
Feb 22, 2025
Mar 14, 2025
Apr 6, 2025
Apr 6, 2025

Repository files navigation

Python recommendation tools

Automatic Tests codecov 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 Anaconda (recommended):

conda install -c conda-forge lenskit

If you use Pixi, you can add it to your project:

pixi add lenskit

Or you can use pip (or uv):

pip install lenskit

To use the latest development version, install directly from GitHub:

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

Then see Getting Started

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 recommend using uv for developing LensKit. Our pyproject.toml file contains the development dependencies. To set up a development environment:

$ uv venv -p 3.12
$ uv sync

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

$ uv sync --all-extras

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

$ . ./.venv/bin/activate

Testing Changes

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

python -m pytest

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:

conda activate my-exp
conda install -c conda-forge
cd /path/to/lkpy
pip install -e . --no-deps

You may need to first uninstall LensKit from your experiment repo; make sure that LensKit's dependencies are all still installed.

Once you have pushed your code to a GitHub branch, you can use a Git repository as a Pip dependency in an environment.yml for your experiment, to keep using the correct modified version of LensKit until your changes make it in to a release.

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.

About

Some Python recommendation tools (Michael's WIP fork, feature branches may be rebased)

Resources

License

Citation

Stars

Watchers

Forks

Languages

  • Python 99.8%
  • Other 0.2%