Blog of Random Thoughts and Pictures

LOI Matchday 8 Predictions

April 30th, 2021

Match day 7 review and a 4 predictions out of 5 is pretty decent this time around, the league must be settling down now.

The running total is 13 out of 35.

Now in to match day 8 predictions.

St. Patricks (68%) vs Longford (11%)
The Probability of a Draw between St. Patricks and Longford is 18%

The number of sim home wins for St. Patricks is = 9
The number of sim away wins for Longford is = 0
The number of sim draw is = 1

St. Patricks (1.72xG) vs Longford (0.81xG)

Going for a St. Pats win here

Drogheda (30%) vs Sligo Rovers (43%)
The Probability of a Draw between Drogheda and Sligo Rovers is 26%

The number of sim home wins for Drogheda is = 0
The number of sim away wins for Sligo Rovers is = 5
The number of sim draw is = 5

Drogheda (1.11xG) vs Sligo Rovers (1.24xG)

Taking it as a draw for this one

Bohemians (40%) vs Derry City (31%)
The Probability of a Draw between Bohemians and Derry City is 28%

The number of sim home wins for Bohemians is = 6
The number of sim away wins for Derry City is = 2
The number of sim draw is = 2

Bohemians (0.97xG) vs Derry City (0.40xG)

Going for a narrow win for Bohs on this one.

Waterford (24%) vs Dundalk (51%)
The Probability of a Draw between Waterford and Dundalk is 24%

The number of sim home wins for Waterford is = 1
The number of sim away wins for Dundalk is = 8
The number of sim draw is = 1

Waterford (0.58xG) vs Dundalk (1.11xG)

Ahh hate saying this but looking like a Dundalk win

Finn Harps (14%) vs Shamrock Rovers (61%)
The Probability of a Draw between Finn Harps and Shamrock Rovers is 24%

The number of sim home wins for Finn Harps is = 0
The number of sim away wins for Shamrock Rovers is = 8
The number of sim draw is = 2

Finn Harps (1.16xG) vs Shamrock Rovers (1.17xG)

The xG is pointing at a draw, and Finn Harps have started well, but will go for the Rovers win in this one.

Good Practice in Football Visualisation

April 25th, 2021

This is a review of a special guest lecture from Opta’s Peter McKeever were he gives some insights in to how to make better data visualisations.

In this video Peter covers:

  • Elements of Matplotlib
  • Under the Hood: rcParams
  • Layering objects with zorder in plots
  • Works through a real world example

The origin of the code is available on Github under the project “friends-of-tracking-viz-lecture” and worked through in this video.

Peter’s slides are available here in this PDF document. Peter also has an excellent blog with code and further examples.

Set up

Under the organisation on Github called mmoffoot I forked the “friends-of-tracking-viz-lecture” repo into the mmoffoot area.

Then I created a new branch called ‘tottenham’ in this area to cover the changes I made.

What was coded

This is another Jupyter Notebook, but this time I just could not get it to load up the highlight_text python library and so I had to create a bog standard Python programme to run through this code base.

Then I found that highlight_text has changed its interface slightly since Peter coded against it. For example in the Notebook there’s the line

htext.fig_htext(s.format(team,ssn_start,ssn_end),0.15,0.99,highlight_colors=[primary], highlight_weights=["bold"],string_weight="bold",fontsize=22, fontfamily=title_font,color=text_color)

I had to change it to

htext.fig_text(0.15,0.86,s.format(team,ssn_start,ssn_end),highlight_colors=[primary], highlight_weights=["bold"],fontweight="bold",fontsize=22, fontfamily=title_font,color=text_color)

Given that Peter McKeever has run through all the elements coded via the YouTube video and there’s an associated slide deck this is a really nice resource to get started on exact visual items and how to then code them up. Of course for devilment I’ve gone for a Tottenham theme for the final output.

Tottenham’s goal difference from 2010/2011 to 2019/2020

Peter also talks about the blog posts by Lisa Rost which are well worth a review on how to visualise data. He also gives a pointer towards Tim Bayer and his work doing some things for Fantasy premier league, all of which is excellent.

Finally there’s ThemePy which is being developed, it is a theme selector / creator and aesthetic manager for Matplotlib. This wrappers aim is to simplify the process of customising matplotlib plots and to enable users who are relatively new to python or matplotlib to move beyond the default plotting params we are given with matplotlib.

LOI Matchday 7 Predictions

April 22nd, 2021

Match day 6 review and got 3 predictions out of 5, and things are getting a bit better.

The running total is 9 out of 30.

Now in to match day 7 predictions

Finn Harps (20%) vs St. Patricks (54%)
The Probability of a Draw between Finn Harps and St. Patricks is 26%

The number of sim home wins for Finn Harps is = 1
The number of sim away wins for St. Patricks is = 8
The number of sim draw is = 1

Finn Harps (1.05xG) vs St. Patricks (0.72xG)

Predicting St. Pats win here

Shamrock Rovers (56%) vs Bohemians (18%)
The Probability of a Draw between Shamrock Rovers and Bohemians is 26%

The number of sim home wins for Shamrock Rovers is = 8
The number of sim away wins for Bohemians is = 0
The number of sim draw is = 2

Shamrock Rovers (1.78xG) vs Bohemians (1.32xG)

Everything pointing to a Rovers win, let’s see

Dundalk (73%) vs Drogheda (8%)
The Probability of a Draw between Dundalk and Drogheda is 14%

The number of sim home wins for Dundalk is = 6
The number of sim away wins for Drogheda is = 0
The number of sim draw is = 4

Dundalk (1.45xG) vs Drogheda (0.67xG)

A Dundalk win here.

Waterford (63%) vs Longford (15%)
The Probability of a Draw between Waterford and Longford is 20%

The number of sim home wins for Waterford is = 7
The number of sim away wins for Longford is = 1
The number of sim draw is = 2

Waterford (0.57xG) vs Longford (0.70xG)

This is looking like a Waterford win, they certainly need one.

Sligo Rovers (42%) vs Derry City (30%)
The Probability of a Draw between Sligo Rovers and Derry City is 28%

The number of sim home wins for Sligo Rovers is = 6
The number of sim away wins for Derry City is = 2
The number of sim draw is = 2

Sligo Rovers (0.94xG) vs Derry City (0.26xG)

Going to go for a draw here.

LOI Matchday 6 Predictions

April 19th, 2021

Match day 5 review and got 2 predictions out of 5, and going a bit mad that I didn’t stick with the system selection of Sligo Rovers over Finn Harps.

The running total is 6 out of 25.

Now in to match day 6 predictions

Drogheda (18%) vs Shamrock Rovers (58%)
The Probability of a Draw between Drogheda and Shamrock Rovers is 23%

The number of sim home wins for Drogheda is = 1
The number of sim away wins for Shamrock Rovers is = 5
The number of sim draw is = 4

Drogheda (1.24xG) vs Shamrock Rovers (0.72xG)

Going for a Shamrock Rovers win.

St. Patricks (49%) vs Waterford (25%)
The Probability of a Draw between St. Patricks and Waterford is 26%

The Probability of a Home win for St. Patricks is 49%
The Probability of an Away win for Waterford is 25%

St. Patricks (1.39xG) vs Waterford (0.6xG)

Going for St. Pats win

Longford (42%) vs Finn Harps (30%)
The Probability of a Draw between Longford and Finn Harps is 28%

The number of sim home wins for Longford is = 5
The number of sim away wins for Finn Harps is = 3
The number of sim draw is = 2

Longford (0.86xG) vs Finn Harps (1.06xG)

Going for a draw in this one

Derry City (25%) vs Dundalk (49%)
The Probability of a Draw between Derry City and Dundalk is 25%

The number of sim home wins for Derry City is = 1
The number of sim away wins for Dundalk is = 8
The number of sim draw is = 1

Derry City (0.86xG) vs Dundalk (0.84xG)

Dundalk win in this case.

Bohemians (39%) vs Sligo Rovers (31%)
The Probability of a Draw between Bohemians and Sligo Rovers is 29%

The number of sim home wins for Bohemians is = 3
The number of sim away wins for Sligo Rovers is = 4
The number of sim draw is = 3

Bohemians (0.35xG) vs Sligo Rovers (1.09xG)

Going for a draw here.

LOI Matchday 5 Predictions

April 15th, 2021

Match day 5, starts with a review of match day 4 results, and I got 2 out of 6 games right, St. Pats are on a roll and won their game, and I got luck for once and got to recall the Derry vs Shamrock Rovers  result in favour of Rovers. For the season so far I’m 4 for 20 at the moment.

I’m going to add a little to the match day 5 predictions and have a little look at xG for the teams too.

So first up here’s what the system software spat out for Waterford vs Bohemians

Waterford (43%) vs Bohemians (29%)
The Probability of a Draw between Waterford and Bohemians is 28%

So the system is going for a Waterford win, but in another part were I simulate the matches I get

The number of sim home wins for Waterford is = 3
The number of sim away wins for Bohemians is = 6
The number of sim draw is = 1

So a Bohemians win.

There are stats for LOI with SoccerStats, and SportsMole being two good examples but for now I’ll just look to expected goals (xG) and that’s best viewed via FootyStats and for this match we have Waterford (0.17 xG) vs Bohemians (0.68 xG) so lets go for a Bohemians win.

For the next match the system has

Derry City (57%) vs Drogheda (19%)
The Probability of a Draw between Derry City and Drogheda is 22%

And in the sim games

The number of sim home wins for Derry City is = 5
The number of sim away wins for Drogheda is = 2
The number of sim draw is = 3

And xG is Derry City (0.71 xG) vs Drogheda (0.56 xG).

Everything is pointing towards a Derry first win of the season …… but Drogheda have started so well. Will have to go with the system answer and call a Derry win on this one.

The next match

Dundalk (56%) vs St. Patricks (19%)
The Probability of a Draw between Dundalk and St. Patricks is 24%

The number of sim home wins for Dundalk is = 6
The number of sim away wins for St. Patricks is = 1
The number of sim draw is = 3

Dundalk (1.35 xG) vs St. Patricks (N/A)

So everything is pointing to a Dundalk win, a first for the season here too …. predicted anyway.

The next match is

Shamrock Rovers (73%) vs Longford (8%)
The Probability of a Draw between Shamrock Rovers and Longford is 16%

The number of sim home wins for Shamrock Rovers is = 8
The number of sim away wins for Longford is = 1
The number of sim draw is = 1

Shamrock Rovers (0.76 xG) vs Longford (0.45 xG)

Calling a Shamrock Rovers win here.

And finally for match day 5 we’ll take

Sligo Rovers (60%) vs Finn Harps (15%)
The Probability of a Draw between Sligo Rovers and Finn Harps is 24%

The number of sim home wins for Sligo Rovers is = 5
The number of sim away wins for Finn Harps is = 3
The number of sim draw is = 2

And the xG Sligo Rovers (0.52 xG) vs Finn Harps (1.2 xG)

Now in this case the xG is in favour of Finn Harps, they are flying I’m going to buck the trend and go for a Finn Harps win.

Player Ranking Framework

April 11th, 2021

As mentioned in Part I of this multipart post, Luca Pappalardo prepared a video, for the Friends of Tracking channel in 2020, to talk about some elements of a paper related to an open Wyscout data set, and advanced statistics related to passing networks, flow centrality and player ranking.

For this post (Part IV) I’m going to cover my take on the PlayeRank framework created by this team of researchers.

I’ve forked the “mapping-match-events-in-Python” repo into my mmoffoot area and created a new branch called ‘englanddata’ to cover the data set of English Premier League information for the 2017-18 season.

An exhaustive description of the PlayeRank framework is available in this paper Pappalardo, Luca, Cintia, Paolo, Ferragina, Paolo, Massucco, Emanuele, Pedreschi, Dino & Giannotti, Fosca (2019) PlayeRank: Data-driven Performance Evaluation and Player Ranking in Soccer via a Machine Learning Approach. ACM Transactions on Intelligent Systems and Technologies 10(5).

This Notebook builds player rankings from match events, the following steps are required:

  • compute feature weights (learning)
  • compute roles (learning)
  • compute performance scores (rating)
  • aggregate performance scores (ranking)

It doesn’t take long to run through the [In] steps of the Notebook and for the English data you end up with Figure 1 as seen below.

Figure 1: Player Ranking English Premier League 2017-2018

The visual output from the Notebook is interactive which is great as you can hover over the points to catch the name. For example in the striker role H. Kane is the outlier (at the top), S. Augero second. There’s even a drop down menu to do a comparison.

Figure 2: Player Ranking Comparison for H. Kane and S. Augero English Premier League 2017-2018

The positions are an interesting element to this ranking systems which is based on a role matrix.

Team Attacking left to right, position 0 is a Striker

And the top players from English Premier League 2017-2018 for each role position

  • Position 0. = H. Kane
  • Position 1. = L. Milivojevic
  • Position 2. = N. Monreal
  • Position 3. = D. Janmaat
  • Position 4. = S. Mane
  • Position 5. = M. Salah
  • Position 6. = N. Otamendi
  • Position 7. = J. Stephens

If I look at the PFA Premier League Team of the Year for 2017-18, Otamendi, Kane and Salah were named in it and also appear here in PlayeRank, but none of the rest. I wonder how D. Silva and K. De Bruyne both of whom are in the PFA team, missed out in this PlayeRank framework.

Overall over 4 posts I can say this is a great Jupyter Notebook, firstly to really learn about Jupyter Notebooks, and secondly to be able to see the structure and how to use WyScout data. It is so important given this data set is used by so many tops clubs for the scouting, analyses and recruitment of players.

I got caught a little on the passing networks, and the flow centrality but certainly a thread of more investigation on a measure of cohesiveness within the team, would be a nice continuation of this topic.

The player ranking and the full explanation of the PlayeRank Framework was fantastic and a joy to read and interact with.

LOI Matchday 4 Predictions

April 8th, 2021

As I go into match day 4, a review of match day 3 reveals that I got, or should I start to say the system got, 1 result correct that was the Sligo Rovers win. While I hedged against them at the weekend it was good to see Waterford FC pick up their first points of the season.

The running tally so far after 14 games is 2 correct predictions, a 14% hit rate so far ….. terrible. Top of a local prediction league is 8 out of 14 so a bit to go there to catch up.

For match day 4 here are the predictions

St. Patricks (47%) vs Derry City (26%)
The Probability of a Draw between St. Patricks and Derry City is 26%

So calling a St. Pats win

Dundalk (62%) vs Bohemians (15%)
The Probability of a Draw between Dundalk and Bohemians is 22%

Dundalk have had a shaky start to the season, but will go for the Dundalk win.

Finn Harps (24%) vs Waterford (49%)
The Probability of a Draw between Finn Harps and Waterford is 27%

Finn Harps are flying it but the system is saying a Waterford win, so will go for the Waterford to win scenario and make up for last week.

Longford (36%) vs Drogheda (38%)
The Probability of a Draw between Longford and Drogheda is 25%

This is very close looks like it could be a draw.

Sligo Rovers (28%) vs Shamrock Rovers (43%)
The Probability of a Draw between Sligo Rovers and Shamrock Rovers is 29%

Dare I say a clash at the top of the table, and will go for a Rovers win …… Shamrock Rovers.

There’s an extra game this week

Derry City (29%) vs Shamrock Rovers (43%)
The Probability of a Draw between Derry City and Shamrock Rovers is 28%

And looks to be another Shamrock Rovers win to really put them top of the table. Now in truth I called this already as a draw a week or so back, but I’m going for Rovers win now.

Passing networks and Flow centrality

April 5th, 2021

As mentioned in Part I of this multipart post, Luca Pappalardo prepared a video, for the Friends of Tracking channel in 2020, to talk about some elements of a paper related to an open Wyscout data set, and advanced statistics related to passing networks, flow centrality and player ranking.

For this post (Part III) I’m going to cover my take on Passing networks and Flow centrality.

I’ve forked the “mapping-match-events-in-Python” repo into my mmoffoot area and created a new branch called ‘englanddata’ to cover the data set of English Premier League information for the 2017-18 season.

Passing networks

This Notebook creates a player passing network for any of the matches covered in the data set. The passing network is a weighted network where nodes are players and weighted edges represent movements of the ball between players. The size of an edge is proportional to the number of passes between the players.

Some finer details on are covered in a research paper Cintia et al., The harsh rule of the goals: data-driven performance indicators for football teams, In Proceedings of the 2015 IEEE International Conference on Data Science and Advanced Analytics (DSAA’2015), 2015.

Now I wanted to continue with a passing network from the Tottenham Hotspur – Leicester City match (2018), given this was the match showing the events to this point, however it just turned out as a blank image for both teams via the Notebook, I tried another match and only got one team and finally the Arsenal – Burnley match turned out what was being looked for, so I moved over to this match.

Arsenal Passing Network, Arsenal – Burnley, May 13, 2018
Burnley Passing Network, Arsenal – Burnley May 13, 2018

The produced images need some time for study, even a quick look leaves me wondering what I can take from them. I also tried to gain some insight from a related paper from the authors P. Cintia, S. Rinzivillo, and L. Pappalardo, “A network-based approach to evaluate the performance of football teams,” in Proceedings of the Machine Learning and Data Mining for Sports Analytics workshop, ECML/PKDD 2015, were it mentions again that nodes are players, directed edges represent passes between players and the size of an edge is proportional to the number of passes between the players. Node 0 indicates the opponent’s goal, and edges ending in 0 node represent goal attempts. However there are no Node 0 in these passing networks.

The related video at minute 15:00 has a section that describes the passing networks too, but unfortunately there’s still not enough in there to give a hint as to what the take away is.

Flow centrality

Next up is flow centrality, which is a feature that can be computed on the passing network and in this Notebook is described as a way to capture the fraction of times that a player intervenes in those paths that result in a shot. They take into account defensive efficiency by letting each player start a number of paths proportional to the number of balls that he recovers during the match.

This concept is only lightly explained in the paper Duch et al., Quantifying the Performance of Individual Players in a Team Activity, PLoS ONE 5(6): e10937 as referenced in the Notebook and I must admit I still didn’t get it, but then a read of a source paper by Freeman LC, A set of measures of centrality based upon betweenness, Sociometry 40: 35–41, 1977 clears it all up “when a particular person in a group is strategically located on the shortest communication path connecting pairs of others, that person is in a central position”, and that same paper goes on to show measures that define centrality in terms of the degree to which a point falls on the shortest path between others and therefore has a potential for control of communication.

Flow Centrality Burnley 2018, Arsenal – Burnley May 13, 2018

Dare I say Westwood (Burnley) is the betweenness man in control for Burnley.

Might be a follow up idea to classify based on how they measure cohesiveness within the team.

LOI Matchday 3 Predictions

April 1st, 2021

Before going into Match day 3 what was predicted from Match day 2, and it was 1 out of 4 matches, the St. Patricks win over Drogheda was the one and only predication right this season and nothing else, although Bohs were 2-0 up in their match at one stage.

Anyway here’s Match day 3 predictions

Longford (23%) vs Sligo Rovers (51%)
Probability of a Draw between Longford and Sligo Rovers is 25%

So calling a Sligo Rovers win and drive towards the top of the table.

Shamrock Rovers (38%) vs Dundalk (34%)
The Probability of a Draw between Shamrock Rovers and Dundalk is 28%

Calling this clash of the giants to end in a draw.

Drogheda (50%) vs Finn Harps (24%)
The Probability of a draw between Drogheda and Finn Harps is 26%

Finn Harps have had a fine start to the season but it will come to a halt in Head in the Game Park I think, so calling a Drogheda win

Derry City (44%) vs Waterford (30%)
The Probability of a Draw between Derry City and Waterford is 26%

The first points of the season will be earned by Derry City

Bohemians (35%) vs St. Patricks (36%)
The Probability of a Draw between Bohemians and St. Patricks is 29%

In this one I’ll sit on the fence and go for a draw.