{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Elo-Win Example" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Itemratingranking
0Arsenal-37.70753512
1Bournemouth37.7075353
2Brighton2.2924655
3Burnley-18.8499779
4Cardiff-20.00000010
5Chelsea37.7075353
6Crystal Palace0.0000007
7Everton20.0000004
8Fulham-37.70753512
9Huddersfield-37.70753512
10Leicester1.1500236
11Liverpool40.0000001
12Man City37.7075353
13Man United-2.2924658
14Newcastle-20.00000010
15Southampton-20.00000010
16Tottenham37.7075353
17Watford38.8499772
18West Ham-37.70753512
19Wolves-21.15002311
\n", "
" ], "text/plain": [ " Item rating ranking\n", "0 Arsenal -37.707535 12\n", "1 Bournemouth 37.707535 3\n", "2 Brighton 2.292465 5\n", "3 Burnley -18.849977 9\n", "4 Cardiff -20.000000 10\n", "5 Chelsea 37.707535 3\n", "6 Crystal Palace 0.000000 7\n", "7 Everton 20.000000 4\n", "8 Fulham -37.707535 12\n", "9 Huddersfield -37.707535 12\n", "10 Leicester 1.150023 6\n", "11 Liverpool 40.000000 1\n", "12 Man City 37.707535 3\n", "13 Man United -2.292465 8\n", "14 Newcastle -20.000000 10\n", "15 Southampton -20.000000 10\n", "16 Tottenham 37.707535 3\n", "17 Watford 38.849977 2\n", "18 West Ham -37.707535 12\n", "19 Wolves -21.150023 11" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from ratingslib.datasets.filenames import dataset_path, FILENAME_EPL_2018_2019_20_GAMES\n", "from ratingslib.ratings.elo import Elo\n", "from ratingslib.utils.enums import ratings\n", "filename = dataset_path(FILENAME_EPL_2018_2019_20_GAMES)\n", "Elo(version=ratings.ELOWIN, starting_point=0).rate_from_file(filename)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.8.13 ('py38')", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.13" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "23ceb7112fbf9d0e38ecbf60d6e6d5e2dcebcc82200eeb1e5a5d5f9ffb9e27ca" } } }, "nbformat": 4, "nbformat_minor": 2 }