- Notifications
You must be signed in to change notification settings - Fork66
Python recommendation toolkit
License
lenskit/lkpy
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
LensKit is a set of Python tools for experimenting with and studying recommendersystems. It provides support for training, running, and evaluating recommenderalgorithms 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].
[!INFO]
LensKit had significant changes in the 2025.1 release. See theMigrationGuide for details.
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 usepip
:
pip install lenskit
To use the latest development version, install directly from GitHub:
pip install -U git+https://github.com/lenskit/lkpy
Then seeGetting Started
To contribute to LensKit, clone or fork the repository, get to work, and submita pull request. We welcome contributions from anyone; if you are looking for aplace to get started, see theissue tracker.
Our development workflow is documented inthe wiki; the wiki alsocontains other information ondeveloping LensKit. User-facing documentation isathttps://lkpy.lenskit.org.
We recommend using Pixi for developing LensKit. Ourpixi.toml
file containsthe development dependencies; to instal l dependencies for all of the LensKitpackages (on Linux or macOS), use thedev-full
environment:
$pixi install -e dev-full
You can usepixi shell
to open a shell within this environment:
$pixi shell -e dev-full
If you are on Windows, usedev-core
instead ofdev-full
; some LensKitpackages will be missing dependencies (specifically Implicit, HPF, and FunkSVD).
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 installyour modified LensKit into your experiment's environment. We recommend usingseparate environments for LensKit development and for each experiment; you willneed to install the modified LensKit into your experiment's repository:
conda activate my-expconda install -c conda-forgecd /path/to/lkpypip install -e . --no-deps
You may need to first uninstall LensKit from your experiment repo; make sure thatLensKit's dependencies are all still installed.
Once you have pushed your code to a GitHub branch, you can use a Git repository asa Pip dependency in anenvironment.yml
for your experiment, to keep using thecorrect modified version of LensKit until your changes make it in to a release.
This material is based upon work supported by the National Science Foundationunder Grant No. IIS 17-51278. Any opinions, findings, and conclusions orrecommendations expressed in this material are those of the author(s) and do notnecessarily reflect the views of the National Science Foundation.
About
Python recommendation toolkit