Skip to main content

Active Preference Learning with Discrete Choice Data

This is an unofficial implementation of the Active Preference Learning with Discrete Choice Data by Brochu et al. as published in NIPS 2007.

Why would this package be useful for you?

Imagine a scenario where you are trying to find a place to have lunch today. There are tons of places to eat around. An app presents you two restaurants to compare at a time and can help you reach a good enough restaurant in as few queries as possible. Each time you pick a restaurant, the model gradually learns what you want and hopefully, its suggestions get gradually better. This will save you a lot of time and when designed well, can be a much more fun way to search as opposed to going through a boring list view.

In general, if the following conditions are present, active preference can be useful for you:

  • User is searching for an item in a very large set of items that's impossible go through one by one.
  • User is okay with a good enough solution if it is going to be found shortly.
  • Items can be embedded in a vectors space where proximity in that space implies similarity in preference between items.

Installation

There are currently two modes of installation: bare bones, extras, development.

Whichever mode, first clone the repository.

git clone git@github.com:dorukhansergin/APL-Brochu.git

Bare Bones

The package requires:

numpy~=1.20.1 
scikit-learn~=0.24.1 
scipy

Change into the folder of the cloned repository and use pip to install.

pip install .

Extras

In addition to bare bones, the following packages will be installed:

streamlit
matplotlib

pip install .\[extras\]

Development

In addition to bare bones, the following packages will be installed:

pytest
pylint 
black 
rope

Change into the folder of the cloned repository and use pip to install, with the dev mode. The -e flag listens to change in code so it's recommended.

pip install -e .\[dev\]

You can run the tests using pytest with the simple pytest command.

Play with the Demo

See above for the installation of extras. The extras has a demo for you to get a feeling for the algorithm. Use the streamlit command to run it.

streamlit run extras/brochu2d.py

Metadata

Release files for APL-Brochu 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for APL-Brochu 0.0.1
File Size Uploaded
APL-Brochu-0.0.1.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for APL-Brochu 0.0.1
File Interpreter ABI Platform
APL_Brochu-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.4 kB

Release files / APL-Brochu-0.0.1.tar.gz

Download URL APL-Brochu-0.0.1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c523018983888d2b04a07af8b72493cd050d5b5e62b41360eb51b9e9effede4d
BLAKE2b-256 checksum
How to use checksums
26df033085f116b4134fd33be128985aeb9bd90b874e4b48f4e340a35b53cf58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.6

Release files / APL_Brochu-0.0.1-py3-none-any.whl

Download URL APL_Brochu-0.0.1-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f5d64db93a2c4ae87c63e36ea827e98abcfd093a79c0bb43da3f8b0352323e4
BLAKE2b-256 checksum
How to use checksums
60ab4b988efa10494304adbe466a733318ffc5d58c295012b3a43e43e0c30547
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.6

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page