Skip to main content

multi-armed bandit policies

Project description

MASCed_bandits

This is a library of multi-armed bandit policies. As of the most recent version the following policies are included: UCB, UCB-Improved, EXP3, EXP3S, EXP4, EwS, ETC, Discounted UCB, Sliding Window UCB, e-greedy.

Example

from masced_bandits.bandit_options import initialize_arguments
from masced_bandits.bandits import init_bandit
import numpy as np

initialize_arguments(["Arm1","Arm2"], 0)

ucb_instance = init_bandit(name='UCB')
for i in range(100):
    arms_chosen = []
    reward = np.random.random()
    arms_chosen.append(ucb_instance.get_next_arm(reward))

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

masced_bandits-1.0.1.tar.gz (11.3 kB view hashes)

Uploaded Source

Built Distribution

masced_bandits-1.0.1-py3-none-any.whl (17.0 kB view hashes)

Uploaded Python 3

Supported by

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