Skip to main content

MABWiser: Parallelizable Contextual Multi-Armed Bandits Library

Project description

MABWiser: Parallelizable Contextual Multi-Armed Bandits

MABWiser is a research library written in Python for rapid prototyping of multi-armed bandit algorithms. It supports context-free, parametric and non-parametric contextual bandit models and provides built-in parallelization for both training and testing components. The library also provides a simulation utility for comparing different policies and performing hyper-parameter tuning. MABWiser follows a scikit-learn style public interface, adheres to PEP-8 standards, and is tested heavily. Full documentation is available at fidelity.github.io/mabwiser.

MABWiser is developed by the Artificial Intelligence Center of Excellence at Fidelity Investments.

Quick Start

# An example that shows how to use the UCB1 learning policy
# to choose between two arms based on their expected rewards.

# Import MABWiser Library
from mabwiser.mab import MAB, LearningPolicy, NeighborhoodPolicy

# Data
arms = ['Arm1', 'Arm2']
decisions = ['Arm1', 'Arm1', 'Arm2', 'Arm1']
rewards = [20, 17, 25, 9]

# Model 
mab = MAB(arms, LearningPolicy.UCB1(alpha=1.25))

# Train
mab.fit(decisions, rewards)

# Test
mab.predict()

Available Bandit Policies

Available Learning Policies:

  • Epsilon Greedy
  • LinTS
  • LinUCB
  • Popularity
  • Random
  • Softmax
  • Thompson Sampling (TS)
  • Upper Confidence Bound (UCB1)

Available Neighborhood Policies:

  • Clusters
  • K-Nearest
  • LSH Nearest
  • Radius

Installation

MABWiser is available to install as: pip install mabwiser

It can also be installed by building from source by following the instructions in our documentation.

Support

Please submit bug reports and feature requests as Issues.

Citation

If you use MABWiser in a publication, please cite it as:

E. Strong, B. Kleynhans, and S. Kadioglu, "MABWiser: A Parallelizable Contextual Multi-Armed Bandit Library for Python," in 2019 IEEE 31st International Conference on Tools with Artificial Intelligence (ICTAI 2019) (pp.885-890). IEEE, 2019.

    @inproceedings{mabwiser2019,
      author    = {Strong, Emily and Kleynhans, Bernard and Kadioglu, Serdar},
      title     = {MABWiser: A Parallelizable Contextual Multi-Armed Bandit Library for Python},
      booktitle = {2019 IEEE 31st International Conference on Tools with Artificial Intelligence (ICTAI 2019)},
      year      = {2019},
      pages     = {885-890},
      organization = {IEEE},
      url       = {https://github.com/fidelity/mabwiser}
    }

License

MABWiser is licensed under the Apache License 2.0.


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

mabwiser-1.11.1.tar.gz (11.1 MB view details)

Uploaded Source

Built Distribution

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

mabwiser-1.11.1-py3-none-any.whl (50.0 kB view details)

Uploaded Python 3

File details

Details for the file mabwiser-1.11.1.tar.gz.

File metadata

  • Download URL: mabwiser-1.11.1.tar.gz
  • Upload date:
  • Size: 11.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.3

File hashes

Hashes for mabwiser-1.11.1.tar.gz
Algorithm Hash digest
SHA256 35ad4fbc7634b640972d11c230017820726ebd4e7ad02c8482d118e76de1baae
MD5 f83c459b54c7ac9a1a35b9286fc38c25
BLAKE2b-256 9ce1b2cd226e336a9353b8699fcabec1b596766da569a582f0b46ab59c85772b

See more details on using hashes here.

File details

Details for the file mabwiser-1.11.1-py3-none-any.whl.

File metadata

  • Download URL: mabwiser-1.11.1-py3-none-any.whl
  • Upload date:
  • Size: 50.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2.post20191203 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.3

File hashes

Hashes for mabwiser-1.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 42e96aa97eea05573f85d97367a5f7999df66cfab4d6e6b513309927dac25b13
MD5 5c646cbe71475b5e1899852ad3aed40f
BLAKE2b-256 810f71b661a27b4351f8f672f7963586ec0126dab5f4fe118fb7986a260c1f4c

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