Skip to main content

Library to compute Gittins and Whittle index for Markovian Bandits

Project description

Markovian Bandits

This repository contains a python library to compute whittle or indices for finite-state Markovian bandit problems.

Installation

To install, just run:

pip install markovianbandit-pkg

Example

from markovianbandit import markovianbandit as bandit
model = bandit.random_restless(dim=4)
print(model.whittle_indices()) # should print (True, array([ 0.51679937, -0.09224213,  0.32943948,  0.29512467]))

model = bandit.random_restless(4, seed=2791)
print(model.is_indexable()) # should print False

model = bandit.random_rested(dim=4)
print(model.gittins_indices(discount=.8)) # computes gittins index

Reference

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

markovianbandit-pkg-0.0.5.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

markovianbandit_pkg-0.0.5-py3-none-any.whl (6.6 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