{"id":13676082,"url":"https://github.com/mathetake/intergo","last_synced_at":"2026-01-03T15:30:17.090Z","repository":{"id":57507145,"uuid":"143970960","full_name":"mathetake/intergo","owner":"mathetake","description":"A package for interleaving / multileaving ranking generation in go","archived":true,"fork":false,"pushed_at":"2019-07-18T01:21:37.000Z","size":115,"stargazers_count":31,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-15T19:11:36.330Z","etag":null,"topics":["ab-testing","go","golang","information-retrieval","interleaving","multileaving","ranking","ranking-algorithm","recommendation-system"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mathetake.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-08T06:34:42.000Z","updated_at":"2024-09-01T03:51:59.000Z","dependencies_parsed_at":"2022-08-29T20:32:09.123Z","dependency_job_id":null,"html_url":"https://github.com/mathetake/intergo","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathetake%2Fintergo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathetake%2Fintergo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathetake%2Fintergo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mathetake%2Fintergo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mathetake","download_url":"https://codeload.github.com/mathetake/intergo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239731598,"owners_count":19687864,"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":["ab-testing","go","golang","information-retrieval","interleaving","multileaving","ranking","ranking-algorithm","recommendation-system"],"created_at":"2024-08-02T13:00:17.938Z","updated_at":"2026-01-03T15:30:17.052Z","avatar_url":"https://github.com/mathetake.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# intergo \n[![CircleCI](https://circleci.com/gh/mathetake/intergo.svg?style=shield\u0026circle-token=89a8a65229dd121bd61be11222cdc2a0416cef22)](https://circleci.com/gh/mathetake/intergo)\n[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)\n[![](https://godoc.org/github.com/mathetake/intergo?status.svg)](http://godoc.org/github.com/mathetake/intergo)\n\nA package for interleaving / multileaving ranking generation in go\n\nIt is mainly tailored to be used for generating interleaved or multileaved ranking based on the following algorithm\n\n- Balanced Interleaving/Multileaving (in `github.com/mathetake/itergo/bm` package)\n- Greedy Optimized Multileaving (in `github.com/mathetake/intergo/gom` package)\n- Team Draft Interleaving/Multileaving (in `github.com/mathetake/itergo/tdm` package)\n\n__NOTE:__ this package aims only at generating a single combined ranking and does not implement the evaluation functions of the given rankings.\n\n## Usage\n\nMake sure that all of your rankings implement `intergo.Ranking` interface defined in `intergo.go`\n\n```go\npackage intergo\n\ntype ID string\n\ntype Ranking interface {\n\tGetIDByIndex(int) ID\n\tLen() int\n}\n```\n\nThen choose one of `bm` or `gom` or `tdm` package which corresponds to the algorithm you want to use.\n\nIn each of these packages, there is a type which implements `intergo.Interleaving` interface defined in `intergo.go`,\n\n```go\npackage intergo\n\ntype Result struct {\n\tRankingIndex int\n\tItemIndex int\n}\n\ntype Interleaving interface {\n\tGetInterleavedRanking(num int, rankings ...Ranking) ([]*Result, error)\n}\n```\nand you can generate interleaved/multileaved ranking by calling `GetInterleavedRanking`.\n\nThe following is an example using Team Draft MultiLeaving (implemented in `tdm` package)\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\t\"github.com/mathetake/intergo\"\n\t\"github.com/mathetake/intergo/tdm\"\n)\n\ntype tRanking []int\n\nfunc (rk tRanking) GetIDByIndex(i int) intergo.ID {\n\treturn intergo.ID(strconv.Itoa(rk[i]))\n}\n\nfunc (rk tRanking) Len() int {\n\treturn len(rk)\n}\n\n// tRanking implements intergo.Ranking interface\nvar _ intergo.Ranking = tRanking{}\n\nfunc main() {\n\tml := \u0026tdm.TeamDraftMultileaving{}\n\trankingA := tRanking{1, 2, 3, 4, 5}\n\trankingB := tRanking{10, 20, 30, 40, 50}\n\n\tidxToRk := map[int]tRanking{\n\t\t0: rankingA,\n\t\t1: rankingB,\n\t}\n\n\tres, _ := ml.GetInterleavedRanking(4, rankingA, rankingB)\n\tiRanking := tRanking{}\n\tfor _, it := range res {\n\t\tiRanking = append(iRanking, idxToRk[it.RankingIndex][it.ItemIndex])\n\t}\n\n\tfmt.Printf(\"Result: %v\\n\", iRanking)\n}\n```\n\n## References\n\n1. Radlinski, Filip, Madhu Kurup, and Thorsten Joachims. \"How does clickthrough data reflect retrieval quality?.\" Proceedings of the 17th ACM conference on Information and knowledge management. ACM, 2008.\n2. Schuth, Anne, et al. \"Multileaved comparisons for fast online evaluation.\" Proceedings of the 23rd ACM International Conference on Conference on Information and Knowledge Management. ACM, 2014.\n3. Manabe, Tomohiro, et al. \"A comparative live evaluation of multileaving methods on a commercial cqa search.\" Proceedings of the 40th International ACM SIGIR Conference on Research and Development in Information Retrieval. ACM, 2017.\n4. Kojiro Iizuka, Takeshi Yoneda, Yoshifumi Seki. \"Greedy Optimized Multileaving for Personalization.\" Proceedings of the 13th International ACM Conference on Recommender Systems. ACM, 2019.\n\n## Author\n\n- [@koiizukag](https://github.com/koiizukag)\n- [@mathetake](https://twitter.com/mathetake)\n\n\n## license\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathetake%2Fintergo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathetake%2Fintergo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathetake%2Fintergo/lists"}