{"id":17465024,"url":"https://github.com/erdogant/thompson","last_synced_at":"2025-04-09T22:22:47.385Z","repository":{"id":57475207,"uuid":"231458137","full_name":"erdogant/thompson","owner":"erdogant","description":"Thompson is Python package to evaluate the multi-armed bandit problem. In addition to thompson, Upper Confidence Bound (UCB) algorithm, and randomized results are also implemented.","archived":false,"fork":false,"pushed_at":"2023-02-21T23:26:00.000Z","size":3612,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T00:16:02.649Z","etag":null,"topics":["bayesian","genetic-algorithm","machine-learning","multi-armed-bandit","python","reinforcement-learning","thompson","thompson-algorithm","ucb"],"latest_commit_sha":null,"homepage":"https://erdogant.github.io/thompson","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erdogant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["erdogant"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2020-01-02T20:55:03.000Z","updated_at":"2023-02-19T17:34:07.000Z","dependencies_parsed_at":"2023-12-31T08:49:47.498Z","dependency_job_id":null,"html_url":"https://github.com/erdogant/thompson","commit_stats":{"total_commits":45,"total_committers":2,"mean_commits":22.5,"dds":0.4666666666666667,"last_synced_commit":"44f3e4acc22a9ed615d72b938f57c90ae61d839f"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Fthompson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Fthompson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Fthompson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erdogant%2Fthompson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erdogant","download_url":"https://codeload.github.com/erdogant/thompson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773733,"owners_count":20993634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bayesian","genetic-algorithm","machine-learning","multi-armed-bandit","python","reinforcement-learning","thompson","thompson-algorithm","ucb"],"created_at":"2024-10-18T11:08:29.860Z","updated_at":"2025-04-09T22:22:47.364Z","avatar_url":"https://github.com/erdogant.png","language":"Python","funding_links":["https://github.com/sponsors/erdogant","https://www.buymeacoffee.com/erdogant)--","https://www.buymeacoffee.com/erdogant"],"categories":[],"sub_categories":[],"readme":"# Multi-armed bandit\n\n[![Python](https://img.shields.io/pypi/pyversions/thompson)](https://img.shields.io/pypi/pyversions/thompson)\n[![PyPI Version](https://img.shields.io/pypi/v/thompson)](https://pypi.org/project/thompson/)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/erdogant/thompson/blob/master/LICENSE)\n[![Downloads](https://pepy.tech/badge/thompson/month)](https://pepy.tech/project/thompson/month)\n[![Downloads](https://pepy.tech/badge/thompson)](https://pepy.tech/project/thompson)\n[![DOI](https://zenodo.org/badge/231458137.svg)](https://zenodo.org/badge/latestdoi/231458137)\n[![Sphinx](https://img.shields.io/badge/Sphinx-Docs-Green)](https://erdogant.github.io/thompson/)\n\u003c!---[![BuyMeCoffee](https://img.shields.io/badge/buymea-coffee-yellow.svg)](https://www.buymeacoffee.com/erdogant)--\u003e\n\u003c!---[![Coffee](https://img.shields.io/badge/coffee-black-grey.svg)](https://erdogant.github.io/donate/?currency=USD\u0026amount=5)--\u003e\n\n* ```Thompson``` is Python package to evaluate the multi-armed bandit problem. In addition to thompson, Upper Confidence Bound (UCB) algorithm, and randomized results are also implemented.\n* In probability theory, the multi-armed bandit problem is a problem in which a fixed limited set of resources must be allocated between competing (alternative) choices in a way that maximizes their expected gain, when each choice's properties are only partially known at the time of allocation, and may become better understood as time passes or by allocating resources to the choice. This is a classic reinforcement learning problem that exemplifies the exploration-exploitation tradeoff dilemma \u003ca href=\"https://en.wikipedia.org/wiki/Multi-armed_bandit\"\u003ewikipedia\u003c/a\u003e. \n* In the problem, each machine provides a random reward from a probability distribution specific to that machine. The objective of the gambler is to maximize the sum of rewards earned through a sequence of lever pulls. The crucial tradeoff the gambler faces at each trial is between \"exploitation\" of the machine that has the highest expected payoff and \"exploration\" to get more information about the expected payoffs of the other machines. The trade-off between exploration and exploitation is also faced in machine learning. In practice, multi-armed bandits have been used to model problems such as managing research projects in a large organization like a science foundation or a pharmaceutical company \u003ca href=\"https://en.wikipedia.org/wiki/Multi-armed_bandit\"\u003ewikipedia\u003c/a\u003e.\n\n# \n**⭐️ Star this repo if you like it ⭐️**\n#\n\n#### Install thompson from PyPI\n\n```bash\npip install thompson\n```\n\n#### Import thompson package\n\n```python\nimport thompson as th\n```\n# \n\n\n### [Documentation pages](https://erdogant.github.io/thompson/)\n\nOn the [documentation pages](https://erdogant.github.io/thompson/) you can find detailed information about the working of the ``thompson`` with examples. \n\n\u003chr\u003e \n\n### Examples\n\n# \n\n* [Example: Compute multi-armed bandit using Thompson](https://erdogant.github.io/thompson/pages/html/Examples.html#)\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://erdogant.github.io/thompson/pages/html/Examples.html#\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/thompson/blob/master/docs/figs/fig_thompson.png\" width=\"900\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n# \n\n\n* [Example: Compute multi-armed bandit using UCB-Upper confidence Bound](https://erdogant.github.io/thompson/pages/html/Examples.html#ucb-upper-confidence-bound)\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://erdogant.github.io/thompson/pages/html/Examples.html#ucb-upper-confidence-bound\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/thompson/blob/master/docs/figs/fig_ucb.png\" width=\"900\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n# \n\n\n* [Example: Compute multi-armed bandit using randomized data](https://erdogant.github.io/thompson/pages/html/Examples.html#randomized-data)\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://erdogant.github.io/thompson/pages/html/Examples.html#randomized-data\"\u003e\n  \u003cimg src=\"https://github.com/erdogant/thompson/blob/master/docs/figs/fig_ucb_random.png\" width=\"900\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n\u003chr\u003e\n\n### References\n* https://en.wikipedia.org/wiki/Multi-armed_bandit\n   \n### Maintainers\n* Erdogan Taskesen, github: [erdogant](https://github.com/erdogant)\n\n### Contribute\n* All kinds of contributions are welcome!\n* If you wish to buy me a \u003ca href=\"https://www.buymeacoffee.com/erdogant\"\u003eCoffee\u003c/a\u003e for this work, it is very appreciated :)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdogant%2Fthompson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferdogant%2Fthompson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferdogant%2Fthompson/lists"}