lenskit/lkpy
Python recommendation toolkit
LensKit for Python (LKPY)
What it is
- A Python library that lets you build, train, run, and evaluate recommender‑system algorithms. It is the successor to the older Java‑based LensKit project and is aimed at researchers, educators, and anyone experimenting with recommendation models.
Why it matters
- Recommender systems (think movie, music, product suggestions) are a core AI application. LKPY provides a clean, modular toolbox that abstracts away the plumbing of data handling, model training, and evaluation, so you can focus on the algorithms you want to test.
Key capabilities (as described in the README)
- Experiment workflow – train models, generate predictions, and compute standard metrics (precision, recall, NDCG, etc.) in a reproducible way.
- Algorithm library – includes classic collaborative‑filtering methods and hooks for custom models, including those built with PyTorch.
- Flexible data handling – works with typical rating matrices, implicit feedback, and can be extended for other interaction data.
- Research‑grade tooling – designed for reproducibility, with CI testing, code coverage, and a citation guide for academic work.
- Cross‑platform installation – available on PyPI and conda‑forge, with optional mirrors for PyTorch binaries to avoid dependency conflicts.
- Development friendliness – uses the modern
uvtool for environment management, provides a dev‑container for VS Code/Zed, and includes a full test suite.
Getting started
- Install the released package (recommended via
uv):
or with classicuv pip install lenskitpip/conda. - Follow the "Getting Started" guide on the documentation site to load a dataset, pick an algorithm, and run an evaluation.
- For the latest code, install directly from GitHub or the LensKit dev PyPI index.
Typical use cases
- Academic research on new recommendation algorithms.
- Classroom labs teaching collaborative filtering and evaluation.
- Prototyping recommender pipelines before moving to production‑grade systems.
Community & support
- Open‑source on GitHub (issues, pull requests, wiki with development workflow).
- Documentation site: https://lkpy.lenskit.org
- Discussion forum via GitHub Discussions.
- Backed by NSF grant funding and published in ACM CIKM 2020 (citation provided).
Bottom line LensKit for Python is a genuine, research‑focused recommender‑system toolkit that fits squarely within the AI/ML ecosystem. It abstracts the experimental workflow while remaining extensible for custom models, making it a solid choice for anyone studying or teaching recommendation algorithms.
Related
- Project
- Project
- Project
- Project
- Project