{ "info": { "author": "Will McGinnis", "author_email": "will@pedalwrencher.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Programming Language :: Python :: 3" ], "description": "Elote\n=====\n\n[![Coverage Status](https://coveralls.io/repos/wdm0006/elote/badge.svg?branch=master&service=github)](https://coveralls.io/github/wdm0006/elote?branch=master) ![travis status](https://travis-ci.org/wdm0006/elote.svg?branch=master) \n\nA python package for rating competitors based on bouts. The classical example of this would be rating chess players based\non repeated head to head matches between different players. The first rating system implemented in elote, the Elo rating\nsystem, was made for just that [3]. Another well known use case would be for college football rankings.\n\nThere are a whole bunch of other use-cases for this sort of system other than sports though, including collaborative\nranking from a group (for voting, prioritizing, or other similar activities).\n\nCurrently implemented rating systems are:\n\n * Elo [3]\n * Glicko-1 [1]\n * ECF [4]\n * DWZ [5]\n\nUsage\n=====\n\nThere are a bunch of examples in the examples directory if you want to dive a little deeper, but \nElote is pretty simple to use. The two objects we care about are Competitors and Arenas. Competitors \nare the things you are rating, and an Arena is a mechanism to schedule Bouts between them. First, Competitors:\n\nCompetitors\n-----------\n\n from elote import EloCompetitor\n\n good = EloCompetitor(initial_rating=400)\n better = EloCompetitor(initial_rating=500)\n\n print('probability of better beating good: %5.2f%%' % (better.expected_score(good) * 100, ))\n print('probability of good beating better: %5.2f%%' % (good.expected_score(better) * 100, ))\n\nThis creates two competitors, intilized with different starting ratings. Right away we can see how a match\nbetween them is likely to go:\n\n probability of better beating good: 64.01%\n probability of good beating better: 35.99%\n\nIf we actually held the match, and there was an upset, updating their rankings is as easy as:\n\n good.beat(better)\n\nor\n\n better.lost_to(good)\n\nWe can then rerun the predictions and see updated probabilities:\n\n probability of better beating good: 61.25%\n probability of good beating better: 38.75%\n\nNot a huge change using default settings.\n\nArenas\n------\n\nArenas are a useful abstraction for scheduling large numbers of bouts or matches. The LambdaArena object \ntakes in a lambda function with two arguments which returns a boolean for if the first argument won (None for ties). Without \never manually setting up any competitors, as long as the arguments are hash-able, the Arena object will create\nall of the competitors, run the matches and rank them all. \n\nHere's a toy example which uses a lambda function that just compares two integers. With this, we've implemented\nthe worst performing, most over complicated sorting algorithm conceivable, but it works:\n\n from elote import LambdaArena\n import json\n import random\n\n\n # sample bout function which just compares the two inputs\n def func(a, b):\n return a > b\n\n matchups = [(random.randint(1, 10), random.randint(1, 10)) for _ in range(1000)]\n\n arena = LambdaArena(func)\n arena.tournament(matchups)\n\n print(json.dumps(arena.leaderboard(), indent=4))\n\nThe final leaderboard looks like:\n\n [\n {\n \"rating\": 560.0,\n \"competitor\": 1\n },\n {\n \"rating\": 803.3256886926524,\n \"competitor\": 2\n },\n {\n \"rating\": 994.1660057704563,\n \"competitor\": 3\n },\n {\n \"rating\": 1096.0912814220258,\n \"competitor\": 4\n },\n {\n \"rating\": 1221.000354671287,\n \"competitor\": 5\n },\n {\n \"rating\": 1351.4243548137367,\n \"competitor\": 6\n },\n {\n \"rating\": 1401.770230395329,\n \"competitor\": 7\n },\n {\n \"rating\": 1558.934907485894,\n \"competitor\": 8\n },\n {\n \"rating\": 1607.6971796462033,\n \"competitor\": 9\n },\n {\n \"rating\": 1708.3786662956998,\n \"competitor\": 10\n }\n ]\n\n\nExamples\n========\n\nIn the examples directory there are a bunch of basic examples using generated data to show different features of elote,\nas well as some use cases using real data, so far all from MasseyRatings.com, but transformed into JSON [2].\n\nInstallation\n============\n\nSoon to be on PyPI, but for now you can fork the repo or install from git.\n\nSupporting only python 3.4+\n\nContributing\n============\n\nThis is very much still a work in progress, so if you're interested in contributing, there is lots to do. Open up an\nissue or a PR and we can coordinate efforts.\n\nReferences\n==========\n\n [1] - http://www.glicko.net/glicko/glicko.pdf\n [2] - MasseyRatings.com\n [3] - Elo, Arpad (1978). The Rating of Chessplayers, Past and Present. Arco. ISBN 0-668-04721-6.\n [4] - http://www.ecfgrading.org.uk/new/help.php#elo\n [5] - https://en.wikipedia.org/wiki/Deutsche_Wertungszahl\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/wdm0006/elote/tarball/0.0.1", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/wdm0006/elote", "keywords": "elo scoring rating", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "elote", "package_url": "https://pypi.org/project/elote/", "platform": "", "project_url": "https://pypi.org/project/elote/", "project_urls": { "Download": "https://github.com/wdm0006/elote/tarball/0.0.1", "Homepage": "https://github.com/wdm0006/elote" }, "release_url": "https://pypi.org/project/elote/0.0.1/", "requires_dist": null, "requires_python": "", "summary": "Python module for rating bouts (like with Elo Rating)", "version": "0.0.1" }, "last_serial": 3850927, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "0663c2a16b3b8c33c71691400b57493a", "sha256": "716cf73ee5f263d900aa004575d117fc4402e1611a4a04290be064f6cb611b82" }, "downloads": -1, "filename": "elote-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0663c2a16b3b8c33c71691400b57493a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9059, "upload_time": "2018-05-10T15:53:21", "url": "https://files.pythonhosted.org/packages/f8/07/e7a2b0f246beff59af1b5048eafcd3fd42a811e8c5c6f965466f5982d1fe/elote-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0fab1e354a56d259cfb10c881f574a14", "sha256": "78225e2ba3c99c946479b4ff7c8c537d9ab67f91a28561db3281f2de4c6f6c0d" }, "downloads": -1, "filename": "elote-0.0.1.tar.gz", "has_sig": false, "md5_digest": "0fab1e354a56d259cfb10c881f574a14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6770, "upload_time": "2018-05-10T15:53:22", "url": "https://files.pythonhosted.org/packages/18/66/69d545188a34cbeaa2ff8e6326f4cb35ee99c6e7528b10b6d240d84e27eb/elote-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0663c2a16b3b8c33c71691400b57493a", "sha256": "716cf73ee5f263d900aa004575d117fc4402e1611a4a04290be064f6cb611b82" }, "downloads": -1, "filename": "elote-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0663c2a16b3b8c33c71691400b57493a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9059, "upload_time": "2018-05-10T15:53:21", "url": "https://files.pythonhosted.org/packages/f8/07/e7a2b0f246beff59af1b5048eafcd3fd42a811e8c5c6f965466f5982d1fe/elote-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0fab1e354a56d259cfb10c881f574a14", "sha256": "78225e2ba3c99c946479b4ff7c8c537d9ab67f91a28561db3281f2de4c6f6c0d" }, "downloads": -1, "filename": "elote-0.0.1.tar.gz", "has_sig": false, "md5_digest": "0fab1e354a56d259cfb10c881f574a14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6770, "upload_time": "2018-05-10T15:53:22", "url": "https://files.pythonhosted.org/packages/18/66/69d545188a34cbeaa2ff8e6326f4cb35ee99c6e7528b10b6d240d84e27eb/elote-0.0.1.tar.gz" } ] }