pypbl
A python library for preference based learning using pairwise comparisons.
Purpose
If we want to recommend a personalised list of items to an individual. We could consider the following:
- Ask the individual to manually rank all items.
- Ask the individual to provide weights based on their preferences of different features (size, cost, weight etc), and calculate the weighted value of each item.
- Find similar people and base recommendations on what these people also like.
- Ask the individual to compare a small number of alternatives, and derive feature weights from those comparisons.
Option 1 quickly becomes an enormous burden on the user as the number of items increases.
Option 2 is difficult for the user to do and replicate. What exactly does it mean if the weight assigned to one feature is double the weight assigned to another?
Option 3 requires lots of data, a way to determine similarity between individuals, and may not be fully personalised.
Option 4 is enabled by preference based learning using pairwise comparisons.
Installing
pip install pypbl
Development
Dependencies and packaging is managed using Poetry.
Install poetry and clone the repository
To create a virtual environment and install dependencies
poetry install
To run tests
poetry run pytest --cov=src --cov-branch --cov-fail-under=90 tests/
To run linting
poetry run flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
- Early versions of this package is heavily based on the PrefeR library by John Lepird.
- PreferenceElicitation.jl by Mykel Kochenderfer.
- Interactive Bayesian Optimisation by Eric Brochu.
TODO
- Improve suggestion engine as using entropy is expensive to compute.
- Include dynasty sampling algorithm and PyMC3 or perhaps pyMC4
- Include preference elicitation using Gaussian Processes see gp_pref_elicit for non-linear utility functions.
Metadata
Release files for pypbl 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pypbl-0.3.1.tar.gz | 8.8 kB | Without provenance | Details for pypbl-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pypbl-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for pypbl-0.3.1-py3-none-any.whl |
Total release size: 17.0 kB
Release files / pypbl-0.3.1.tar.gz
| Download URL | pypbl-0.3.1.tar.gz |
|---|---|
| Size | 8.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45fbd4c34f4d911949ca8a7dffc428806a05b3e742e1e052aa19acb9490d32fd
|
|
BLAKE2b-256 checksum How to use checksums |
cb212d6d1581abb0e7e2a30636e3c661f61ed62d20b9d6f5b56aaa614c429f7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0 CPython/3.7.9 Linux/5.4.0-1036-azure
|
Release files / pypbl-0.3.1-py3-none-any.whl
| Download URL | pypbl-0.3.1-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0af909ade86a0a89b3ff240f9eff68c2b058be85d631cfe6464b643e7f4946c5
|
|
BLAKE2b-256 checksum How to use checksums |
7071c89d1aa589cd67d9eaf8c1c590b6ea5f773f0c68ad6feac29d884bdc7fb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0 CPython/3.7.9 Linux/5.4.0-1036-azure
|
Security for pypbl 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.