Colley Ratings
[1]:
import sys
sys.path.append("../")
import penaltyblog as pb
[2]:
fbd = pb.scrapers.FootballData("ENG Premier League", "2021-2022")
df = fbd.get_fixtures()
df.head()
[2]:
div | team_home | team_away | fthg | ftag | ftr | hthg | htag | htr | referee | ... | ah_ch | b365_cahh | b365_caha | pcahh | pcaha | max_cahh | max_caha | avg_cahh | avg_caha | datetime | |||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
competition | season | id | |||||||||||||||||||||
ENG Premier League | 2021-2022 | 1628812800---brentford---arsenal | E0 | Brentford | Arsenal | 2 | 0 | H | 1 | 0 | H | M Oliver | ... | 0.50 | 1.75 | 2.05 | 1.81 | 2.13 | 2.05 | 2.17 | 1.80 | 2.09 | 2021-08-13 20:00:00 |
1628899200---burnley---brighton_&_hove_albion | E0 | Burnley | Brighton & Hove Albion | 1 | 2 | A | 1 | 0 | H | D Coote | ... | 0.25 | 1.79 | 2.15 | 1.81 | 2.14 | 1.82 | 2.19 | 1.79 | 2.12 | 2021-08-14 15:00:00 | ||
1628899200---chelsea---crystal_palace | E0 | Chelsea | Crystal Palace | 3 | 0 | H | 2 | 0 | H | J Moss | ... | -1.50 | 2.05 | 1.75 | 2.12 | 1.81 | 2.16 | 1.93 | 2.06 | 1.82 | 2021-08-14 15:00:00 | ||
1628899200---everton---southampton | E0 | Everton | Southampton | 3 | 1 | H | 0 | 1 | A | A Madley | ... | -0.50 | 2.05 | 1.88 | 2.05 | 1.88 | 2.08 | 1.90 | 2.03 | 1.86 | 2021-08-14 15:00:00 | ||
1628899200---leicester_city---wolverhampton_wanderers | E0 | Leicester City | Wolverhampton Wanderers | 1 | 0 | H | 1 | 0 | H | C Pawson | ... | -0.75 | 2.02 | 1.91 | 2.01 | 1.92 | 2.05 | 1.95 | 1.99 | 1.89 | 2021-08-14 15:00:00 |
5 rows × 105 columns
Colley ratings including tied scorelines
[3]:
colley = pb.ratings.Colley(df["fthg"], df["ftag"], df["team_home"], df["team_away"])
colley.get_ratings()
[3]:
team | rating | |
---|---|---|
0 | Liverpool | 1.904762 |
1 | Manchester City | 1.892857 |
2 | Chelsea | 1.791667 |
3 | Tottenham Hotspur | 1.708333 |
4 | Arsenal | 1.672619 |
5 | Manchester United | 1.654762 |
6 | Brighton & Hove Albion | 1.64881 |
7 | Crystal Palace | 1.625 |
8 | West Ham | 1.619048 |
9 | Leicester City | 1.607143 |
10 | Newcastle United | 1.583333 |
11 | Wolverhampton Wanderers | 1.559524 |
12 | Southampton | 1.541667 |
13 | Brentford | 1.529762 |
14 | Burnley | 1.511905 |
15 | Aston Villa | 1.511905 |
16 | Leeds United | 1.505952 |
17 | Everton | 1.464286 |
18 | Norwich City | 1.339286 |
19 | Watford | 1.327381 |
Colley ratings excluding tied scorelines
[4]:
colley = pb.ratings.Colley(df["fthg"], df["ftag"], df["team_home"], df["team_away"], include_draws=False)
colley.get_ratings()
[4]:
team | rating | |
---|---|---|
0 | Liverpool | 0.809524 |
1 | Manchester City | 0.809524 |
2 | Chelsea | 0.678571 |
3 | Tottenham Hotspur | 0.630952 |
4 | Arsenal | 0.607143 |
5 | Manchester United | 0.547619 |
6 | West Ham | 0.52381 |
7 | Brighton & Hove Albion | 0.511905 |
8 | Leicester City | 0.5 |
9 | Crystal Palace | 0.488095 |
10 | Newcastle United | 0.47619 |
11 | Wolverhampton Wanderers | 0.47619 |
12 | Brentford | 0.440476 |
13 | Aston Villa | 0.428571 |
14 | Southampton | 0.416667 |
15 | Leeds United | 0.392857 |
16 | Everton | 0.380952 |
17 | Burnley | 0.380952 |
18 | Norwich City | 0.25 |
19 | Watford | 0.25 |