Skip to main content

Thompson Sampling

Project description

# thompson-sampling
Thompson Sampling Experiment in Python

This project is an implementation of a Thompson Sampling approach to a Multi-Armed Bandit. The goal of this project is to easily create and maintain Thompson Sampling experiments.

Currently this project supports experiments where the response follows a Bernoulli or Poisson distribution. Further work will be done to allow for experiments that follow other distributions, with recommendations/collaboration welcome.

## Usage

### Setting up the experiment:
The following method will instantiate the experiment with default priors.
```python
from thompson_sampling.bernoulli import BernoulliExperiment

experiment = BernoulliExperiment(arms=2)
```

If you want set your own priors:
```python

from thompson_sampling.bernoulli import BernoulliExperiment

experiment = BernoulliExperiment(priors=[{"a":10, "b":5}, {"a":1, "b":2}])
```

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

thompson-sampling-0.0.0.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

thompson_sampling-0.0.0-py3-none-any.whl (4.3 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