Python code from the book Bandit Algorithms for Website Optimization
Project description
Bandit Code for the Book "Reinforcement Learning"
This repository was forked from John Myles White's "BanditsBook" repository.
I have removed all the non-python code and added a setup.py file to allow for pip installs. Everything else is the same.
Installing
pip install banditsbook
Getting Started
from arms.bernoulli import BernoulliArm
from testing_framework.tests import test_algorithm
from algorithms.epsilon_greedy.standard import EpsilonGreedy
num_sims = 1000
horizon = 10
arm0 = BernoulliArm(0.2)
arm1 = BernoulliArm(0.2)
arms = [arm0, arm1]
algo1 = EpsilonGreedy(0.1, [], [])
sim_nums, times, chosen_arms, rewards, cumulative_rewards = test_algorithm(
algo1, arms, num_sims, horizon)
print(rewards)
See the original repository for more information: https://github.com/johnmyleswhite/BanditsBook
Icons made by Good Ware from www.flaticon.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
banditsbook-0.1.1.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for banditsbook-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54040cad53012ddfd5fabc1e6afcdd40c7ee1201e8868339528dccc8ce1f089f |
|
MD5 | aadffebac65cdcf026688c6b7037a9fb |
|
BLAKE2b-256 | 68c0afdf81ebc086acae3f536424922716a1f2fa8a45fec573e6a62e0d01136f |