Skip to main content

A python library for preference based learning using pairwise comparisons.

Project description

pypbl

Actions Status Documentation Status Binder

A python library for preference based learning using pairwise comparisons.

We want to recommend a personalised list of items to an individual.

There are three approaches we could take:

  1. Ask the individual to manually rank all items.
  2. 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.
  3. Find similar people and base recommendations on what these people also like.
  4. Ask the individual 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 are 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

TODO

  • Improve suggestion engine as using entropy is expensive and required a hammer to compute accurately
  • Include dynasty sampling algorithm and PyMC3 or perhaps pyMC4
  • Include preference elicitation using Gaussian Processes see gp_pref_elicit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypbl-0.3.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pypbl-0.3.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file pypbl-0.3.0.tar.gz.

File metadata

  • Download URL: pypbl-0.3.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.6 Linux/5.0.0-1032-azure

File hashes

Hashes for pypbl-0.3.0.tar.gz
Algorithm Hash digest
SHA256 727304606eb6e087bfccbc28a121807a87f7ee004cffb3c71d14bca663c0d88e
MD5 4f405be43372204a93309d8c950cc349
BLAKE2b-256 8bffd317b80254fdcd0cb7af06cfee2760c776b4b0fb1cef4a5c07301097a362

See more details on using hashes here.

File details

Details for the file pypbl-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pypbl-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.6 Linux/5.0.0-1032-azure

File hashes

Hashes for pypbl-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dadf4b7eff500ddd8949cc43ef11d4f51a5cf7457bdef060f345d10813517e7f
MD5 05023b0a35a7fc421ad191ed74f88a84
BLAKE2b-256 a15fb67058f97978f43c9b2c091a59bcd5e59c9374dc6d2607faae162f402131

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page