Thompson Sampling
Project description
# thompson-sampling
Thompson Sampling Multi-Armed Bandit for 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}])
```
## Installation
### Pip
```
pip install thompson-sampling
```
Thompson Sampling Multi-Armed Bandit for 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}])
```
## Installation
### Pip
```
pip install thompson-sampling
```
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
Built Distribution
Close
Hashes for thompson_sampling-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c993aee5c2066e617912716db18407f908b4c8f5a984793e39de5225ea626317 |
|
MD5 | 61c512e3c441683e5b5bbc90cde17805 |
|
BLAKE2b-256 | c192dde676cc3ae8aa24104ba41aa7a9d1c222695c00160730ccf21e76e25f18 |