{"id":16776993,"url":"https://github.com/rueian/gobandit","last_synced_at":"2025-04-10T20:14:25.721Z","repository":{"id":77671961,"uuid":"181277541","full_name":"rueian/gobandit","owner":"rueian","description":"A golang library for solving multi armed bandit problem which can optimize your business choice on the fly without A/B testing","archived":false,"fork":false,"pushed_at":"2019-04-15T16:33:18.000Z","size":7,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T17:55:19.189Z","etag":null,"topics":["enforcement","golang","multi-armed-bandit","thompson-sampling"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rueian.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-14T08:01:11.000Z","updated_at":"2024-04-06T09:35:35.000Z","dependencies_parsed_at":"2023-02-26T20:30:34.035Z","dependency_job_id":null,"html_url":"https://github.com/rueian/gobandit","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rueian%2Fgobandit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rueian%2Fgobandit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rueian%2Fgobandit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rueian%2Fgobandit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rueian","download_url":"https://codeload.github.com/rueian/gobandit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248288383,"owners_count":21078903,"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":["enforcement","golang","multi-armed-bandit","thompson-sampling"],"created_at":"2024-10-13T07:11:34.239Z","updated_at":"2025-04-10T20:14:25.700Z","avatar_url":"https://github.com/rueian.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gobandit\n\n[![CircleCI](https://circleci.com/gh/rueian/gobandit.svg?style=svg)](https://circleci.com/gh/rueian/gobandit)\n[![codecov](https://codecov.io/gh/rueian/gobandit/branch/master/graph/badge.svg)](https://codecov.io/gh/rueian/gobandit)\n\nA golang library for solving multi armed bandit problem which can optimize your business choice on the fly without A/B testing.\n\n## Thompson Sampling\n\n```go\npackage main\n\nimport (\n\t\"time\"\n\t\n\t\"github.com/rueian/gobandit/thompson\"\n)\n\nfunc init() {\n\tthompson.Seed(time.Now().Unix())\n}\n\nfunc main() {\n    // load your candidate statistics, for example:\n    candidates := [][2]float64{\n        {1000, 500}, // candidate 0 =\u003e likeCount: 1000, dislikeCount: 500\n        {500, 1000}, // candidate 1 =\u003e likeCount: 500, dislikeCount: 1000\n    }\n    \n    for {\n        // let Thompson Sampling choose a candidate based on the statistics\n        elected, _ := thompson.Choose(candidates)\n        \n        // use the elected one, and collect feedback to update the statistic for next choose\n        if peopleLike(elected) {\n            candidates[elected][0]++\n        } else {\n            candidates[elected][1]++\n        }\n        \n        if done() {\n            break\n        }\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frueian%2Fgobandit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frueian%2Fgobandit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frueian%2Fgobandit/lists"}