{ "info": { "author": "Anton1o-I", "author_email": "a.iniguez21@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# thompson-sampling\nThompson Sampling Multi-Armed Bandit for Python\n\nThis 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.\n\nCurrently 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.\n\n## Usage\n\n### Setting up the experiment:\nThe following method will instantiate the experiment with default priors.\n```python\nfrom thompson_sampling.bernoulli import BernoulliExperiment\n\nexperiment = BernoulliExperiment(arms=2)\n```\n\nIf you want set your own priors using the Priors module:\n```python\n\nfrom thompson_sampling.bernoulli import BernoulliExperiment\nfrom thompson_sampling.priors import BetaPrior\n\npr = BetaPrior()\npr.add_one(mean=0.5, variance=0.2, effective_size=10, label=\"option1\")\npr.add_one(mean=0.6, variance=0.3, effective_size=30, label=\"option2\")\nexperiment = BernoulliExperiment(priors=pr)\n```\n\n### Getting an action:\nRandomly chooses which arm to \"pull\" in the multi-armed bandit:\n```python\nexperiment.choose_arm()\n```\n\n### Updating reward:\nUpdating the information about the different arms by adding reward information:\n\n```python\nrewards = [{\"label\":\"option1\", \"reward\":1}, {\"label\":\"option2\", \"reward\":0}]\nexperiment.add_rewards(rewards)\n```\n\n## Installation\n\n### Pip \n```\npip install thompson-sampling\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Anton1o-I/thompson-sampling", "keywords": "", "license": "LICENSE.txt", "maintainer": "", "maintainer_email": "", "name": "thompson-sampling", "package_url": "https://pypi.org/project/thompson-sampling/", "platform": "", "project_url": "https://pypi.org/project/thompson-sampling/", "project_urls": { "Homepage": "https://github.com/Anton1o-I/thompson-sampling" }, "release_url": "https://pypi.org/project/thompson-sampling/0.0.3/", "requires_dist": [ "typing", "numpy", "seaborn", "matplotlib", "pandas" ], "requires_python": "", "summary": "Thompson Sampling", "version": "0.0.3" }, "last_serial": 5273424, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "44bcb6770bedab1e1fce17a16f8134bf", "sha256": "d0455fb1e0701b9e2094b180b10a150e7d7992ec411869cb525127b0c37fd1c4" }, "downloads": -1, "filename": "thompson_sampling-0.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "44bcb6770bedab1e1fce17a16f8134bf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4292, "upload_time": "2019-02-01T20:50:04", "url": "https://files.pythonhosted.org/packages/a6/90/5e1cb6f566aa17f2ec0cf489e6e56891d2bee5607600b113b247492465cd/thompson_sampling-0.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "62d73691f8a3efed00562e24dfb91113", "sha256": "2e399a6c0ff391cab61772b15dc2391f8ad2d88693850af8eaf36a298fb7d314" }, "downloads": -1, "filename": "thompson-sampling-0.0.0.tar.gz", "has_sig": false, "md5_digest": "62d73691f8a3efed00562e24dfb91113", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2688, "upload_time": "2019-02-01T20:50:06", "url": "https://files.pythonhosted.org/packages/ec/b7/1206c119acfcc6c1631cdae32b974ae990e8edb6181f13dd13755a36c169/thompson-sampling-0.0.0.tar.gz" } ], "0.0.1": [ { "comment_text": "", "digests": { "md5": "61c512e3c441683e5b5bbc90cde17805", "sha256": "c993aee5c2066e617912716db18407f908b4c8f5a984793e39de5225ea626317" }, "downloads": -1, "filename": "thompson_sampling-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "61c512e3c441683e5b5bbc90cde17805", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6543, "upload_time": "2019-02-07T23:08:46", "url": "https://files.pythonhosted.org/packages/c1/92/dde676cc3ae8aa24104ba41aa7a9d1c222695c00160730ccf21e76e25f18/thompson_sampling-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1ad8fad5b1d0a8bc33bc31e38d5b56f5", "sha256": "dd6dc53861e0e6f72517b85fa23d0fc8ae9346e3b34c0074f73cbde138a979d8" }, "downloads": -1, "filename": "thompson-sampling-0.0.1.tar.gz", "has_sig": false, "md5_digest": "1ad8fad5b1d0a8bc33bc31e38d5b56f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3838, "upload_time": "2019-02-07T23:08:47", "url": "https://files.pythonhosted.org/packages/9f/fc/60a65d082040d799ad958c1940b07bf9c2292b0f8a77b29a564fd0dcd445/thompson-sampling-0.0.1.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "49e12114d11fb7b06b462b1c44f55f4e", "sha256": "9178b05045473a5d853adf239ae9312bf758469990639ff4ac17f9fc76f2d221" }, "downloads": -1, "filename": "thompson_sampling-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "49e12114d11fb7b06b462b1c44f55f4e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7966, "upload_time": "2019-05-15T17:00:21", "url": "https://files.pythonhosted.org/packages/fb/03/ade6cf35bdc63047943ea8d3e63d62366c83988714cd11c1deeacfb4c003/thompson_sampling-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f5f95e121db2c70d210b256bacf40875", "sha256": "dc47772a3864492297416160a230d309a17f256c163cd9b8a3dec9a1b33a886a" }, "downloads": -1, "filename": "thompson-sampling-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f5f95e121db2c70d210b256bacf40875", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4345, "upload_time": "2019-05-15T17:00:22", "url": "https://files.pythonhosted.org/packages/88/86/b525f9fcf479a040c6408f97b1bb79107981d5cdf0365b1531d5e99e6ab0/thompson-sampling-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "49e12114d11fb7b06b462b1c44f55f4e", "sha256": "9178b05045473a5d853adf239ae9312bf758469990639ff4ac17f9fc76f2d221" }, "downloads": -1, "filename": "thompson_sampling-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "49e12114d11fb7b06b462b1c44f55f4e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7966, "upload_time": "2019-05-15T17:00:21", "url": "https://files.pythonhosted.org/packages/fb/03/ade6cf35bdc63047943ea8d3e63d62366c83988714cd11c1deeacfb4c003/thompson_sampling-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f5f95e121db2c70d210b256bacf40875", "sha256": "dc47772a3864492297416160a230d309a17f256c163cd9b8a3dec9a1b33a886a" }, "downloads": -1, "filename": "thompson-sampling-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f5f95e121db2c70d210b256bacf40875", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4345, "upload_time": "2019-05-15T17:00:22", "url": "https://files.pythonhosted.org/packages/88/86/b525f9fcf479a040c6408f97b1bb79107981d5cdf0365b1531d5e99e6ab0/thompson-sampling-0.0.3.tar.gz" } ] }