{ "cells": [ { "cell_type": "markdown", "id": "590466c4-32bc-4d3e-89b1-66f15ef61d56", "metadata": {}, "source": [ "# Massey Ratings\n", "\n", "Massey Ratings provide a mathematically robust method for evaluating and ranking football teams based on their match results. \n", "\n", "The Massey Rating system considers the strength of each team's opponents and the margins of victory or defeat, resulting in ratings that accurately reflect relative team performance. \n", "\n", "This makes it particularly useful for predicting outcomes, comparing team quality across leagues, and informing betting decisions by identifying teams whose performance might be underrated or overrated by bookmakers." ] }, { "cell_type": "code", "execution_count": 1, "id": "a23baca5-1387-4d56-9c8a-59bf2633bd84", "metadata": {}, "outputs": [], "source": [ "import penaltyblog as pb" ] }, { "cell_type": "code", "execution_count": 2, "id": "bea84cd8-7e75-4863-9ece-349870e19e53", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | date | \n", "datetime | \n", "season | \n", "competition | \n", "div | \n", "time | \n", "team_home | \n", "team_away | \n", "fthg | \n", "ftag | \n", "... | \n", "b365_cahh | \n", "b365_caha | \n", "pcahh | \n", "pcaha | \n", "max_cahh | \n", "max_caha | \n", "avg_cahh | \n", "avg_caha | \n", "goals_home | \n", "goals_away | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
1599868800---crystal_palace---southampton | \n", "2020-09-12 | \n", "2020-09-12 15:00:00 | \n", "2020-2021 | \n", "ENG Premier League | \n", "E0 | \n", "15:00 | \n", "Crystal Palace | \n", "Southampton | \n", "1 | \n", "0 | \n", "... | \n", "1.78 | \n", "2.13 | \n", "1.79 | \n", "2.17 | \n", "1.85 | \n", "2.18 | \n", "1.79 | \n", "2.12 | \n", "1 | \n", "0 | \n", "
1599868800---fulham---arsenal | \n", "2020-09-12 | \n", "2020-09-12 12:30:00 | \n", "2020-2021 | \n", "ENG Premier League | \n", "E0 | \n", "12:30 | \n", "Fulham | \n", "Arsenal | \n", "0 | \n", "3 | \n", "... | \n", "2.01 | \n", "1.89 | \n", "2.02 | \n", "1.91 | \n", "2.13 | \n", "1.92 | \n", "2.02 | \n", "1.87 | \n", "0 | \n", "3 | \n", "
1599868800---liverpool---leeds | \n", "2020-09-12 | \n", "2020-09-12 17:30:00 | \n", "2020-2021 | \n", "ENG Premier League | \n", "E0 | \n", "17:30 | \n", "Liverpool | \n", "Leeds | \n", "4 | \n", "3 | \n", "... | \n", "1.85 | \n", "2.05 | \n", "1.85 | \n", "2.08 | \n", "1.90 | \n", "2.16 | \n", "1.84 | \n", "2.04 | \n", "4 | \n", "3 | \n", "
1599868800---west_ham---newcastle | \n", "2020-09-12 | \n", "2020-09-12 20:00:00 | \n", "2020-2021 | \n", "ENG Premier League | \n", "E0 | \n", "20:00 | \n", "West Ham | \n", "Newcastle | \n", "0 | \n", "2 | \n", "... | \n", "2.03 | \n", "1.87 | \n", "2.04 | \n", "1.88 | \n", "2.09 | \n", "1.91 | \n", "2.02 | \n", "1.86 | \n", "0 | \n", "2 | \n", "
1599955200---tottenham---everton | \n", "2020-09-13 | \n", "2020-09-13 16:30:00 | \n", "2020-2021 | \n", "ENG Premier League | \n", "E0 | \n", "16:30 | \n", "Tottenham | \n", "Everton | \n", "0 | \n", "1 | \n", "... | \n", "2.09 | \n", "1.81 | \n", "2.09 | \n", "1.85 | \n", "2.16 | \n", "1.86 | \n", "2.08 | \n", "1.81 | \n", "0 | \n", "1 | \n", "
5 rows × 111 columns
\n", "\n", " | team | \n", "rating | \n", "offence | \n", "defence | \n", "
---|---|---|---|---|
0 | \n", "Man City | \n", "1.275 | \n", "1.486184 | \n", "-0.211184 | \n", "
1 | \n", "Man United | \n", "0.725 | \n", "1.238962 | \n", "-0.513962 | \n", "
2 | \n", "Liverpool | \n", "0.65 | \n", "1.10424 | \n", "-0.45424 | \n", "
3 | \n", "Tottenham | \n", "0.575 | \n", "1.108406 | \n", "-0.533406 | \n", "
4 | \n", "Chelsea | \n", "0.55 | \n", "0.832018 | \n", "-0.282018 | \n", "
5 | \n", "Leicester | \n", "0.45 | \n", "1.115351 | \n", "-0.665351 | \n", "
6 | \n", "Arsenal | \n", "0.4 | \n", "0.757018 | \n", "-0.357018 | \n", "
7 | \n", "West Ham | \n", "0.375 | \n", "0.952851 | \n", "-0.577851 | \n", "
8 | \n", "Aston Villa | \n", "0.225 | \n", "0.76674 | \n", "-0.54174 | \n", "
9 | \n", "Leeds | \n", "0.2 | \n", "0.962573 | \n", "-0.762573 | \n", "
10 | \n", "Everton | \n", "-0.025 | \n", "0.558406 | \n", "-0.583406 | \n", "
11 | \n", "Brighton | \n", "-0.15 | \n", "0.370906 | \n", "-0.520906 | \n", "
12 | \n", "Newcastle | \n", "-0.4 | \n", "0.551462 | \n", "-0.951462 | \n", "
13 | \n", "Wolves | \n", "-0.4 | \n", "0.273684 | \n", "-0.673684 | \n", "
14 | \n", "Southampton | \n", "-0.525 | \n", "0.586184 | \n", "-1.111184 | \n", "
15 | \n", "Burnley | \n", "-0.55 | \n", "0.198684 | \n", "-0.748684 | \n", "
16 | \n", "Crystal Palace | \n", "-0.625 | \n", "0.425073 | \n", "-1.050073 | \n", "
17 | \n", "Fulham | \n", "-0.65 | \n", "0.037573 | \n", "-0.687573 | \n", "
18 | \n", "West Brom | \n", "-1.025 | \n", "0.280629 | \n", "-1.305629 | \n", "
19 | \n", "Sheffield United | \n", "-1.075 | \n", "-0.13326 | \n", "-0.94174 | \n", "