Blog of Random Thoughts and Pictures

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.

Advanced football visualisations duels on the pitch Italy compared to England

March 27th, 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 II) I’m going to cover my take on the match evolution and spatial stats.

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.

Spatial distribution of events

There are tons of events collated in the WyScout API Events from duels to fouls to interruptions, as explained in the WyScout API document. For passes there are 6 types:

  • Pass = Hand pass,
  • Pass = Head pass,
  • Pass = High pass,
  • Pass = Launch,
  • Pass = Simple pass,
  • Pass = Smart pass,

In this Notebook there’s an interesting set of images created which show the distribution of positions per event type. These kernel density plots show the distribution of the events’ positions during the match with the darker the green representing the higher number of events in a specific zone of the field.

Figure 1: Move the slider to compare Italian Serie A Duels and English Premier League Duels 2017-18

The first image is of duels, and in the WyScout world “Duel” has a specific meaning,

A challenge between two players to gain control of the ball, progress with the ball or change its direction.

With a number of subtypes to consider too: Defensive duel, Offensive duel, Aerial duel, Loose ball duel, and Sliding tackle

For the moment I’m not going into the whys and wherefores of these subtypes, but it’s really interesting to review and compare the images and to see the difference of where the Italian league and the English league host their duels. Dare I say right-backs, left-backs and right wingers, left wingers should look closer if they are moving between the leagues.

A big summer move from England to Italy was Emre Can from Liverpool to Juventus, with Stephan Lichtsteiner coming in from Juventus to Arsenal maybe a view of these plots before the new 2018-19 season got underway might have been handy.

Of note there’s a 10,000 event sample size in here by default, so for the Italian & English league this represents about 6 matches worth of events, and so a larger sample size would be nice to see and compare against. Would also be nice to identify specific players (RB,LB and RW, LW) that were strong in those main duel locations, however that will have to be for another day.

Here are where the fouls happen.

Figure 2: Move slider to compare Italian Serie A Fouls and English Premier League Fouls 2017-18

And the shots.

Figure 3: Move the slide to compare Italian Serie A shots and English Premier League shots 2017-18

Intra-match evolution of the events

Goals are the main stay of football and so when looking at the English and Italian leagues (season 2017-18), its pleasing to see the difference between the leagues, especially the 1st half goals.

Yellow cards and red cards are covered in the data set too, and displayed in the Jupyter Notebook but I’ll be honest and say I didn’t take too much time to analyse the results here, because I was fascinated by the Duel plots.

LOI Matchday 2 Predictions

March 25th, 2021

Here’s another go at the match day predictions, using past match results

For match day 2 in the League of Ireland Premier division

Dundalk (76%) vs Finn Harps (6%)
Draw (13%)

Calling a Dundalk win here

Waterford (43%) vs Sligo Rovers (30%)
Draw (27%)

Calling a drawn match

Bohemians (62%) vs Longford Town (15%)
Draw (22%)

Calling a Bohemians win

St. Patricks (62%) vs Drogheda (15%)
Draw (21%)

Calling a St. Patricks win

Derry City (29%) vs Shamrock Rovers (43%)
Draw (28%)

Calling a drawn match here once it eventually gets played.

Advanced football visualisations and data analysis of match events

March 22nd, 2021

Luca Pappalardo an author of the paper (PCR2019) Pappalardo, L., Cintia, P., Rossi, A. et al. A public data set of spatio-temporal match events in soccer competitions. Nature Scientific Data 6, 236 (2019) prepared a video, for the Friends of Tracking channel in 2020, to talk about some elements of this paper and the related Wyscout data set, which was used for the paper.

In this video Luca covers:

  • The Wyscout data set, how it is collected, from players to events.
  • Basic statistics on events and distributions.
  • Plotting events on the field, match evolution and spatial stats.
  • Advanced statistics: passing networks, flow centrality and playerRank

For this blog post I’m going to cover my take on the player events in the Wyscout data set and the display of some basic statistics on events and distributions.

The origin of the code is available on Github under the project “mapping-match-events-in-Python” and worked through in this video.

Set up

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

The example code base uses the Italian league data, but the branch name might be a give away, seeing as the data set has English Premier League information for the 2017-18 season I wanted to run the code base against that data set, and so I took a copy of the original Jupyter Notebook and ran it against the English data as data_england_exploration.ipynb.

The full list of data available includes:

  • Italian first division 2017-18
  • English first division 2017-18
  • Spanish first division 2017-18
  • French first division 2017-18
  • German first division 2017-18
  • European Championship 2017-18
  • World Cup 2018

All the matches, events, players, and competition data sets are hosted in a figshare repository with all the data stored in a JSON format.

The way the data is collected is explained in the paper, with a nice visual representation in the Notebook so I won’t ruin that insight and will let you read it in there.

I should say a quick word on Jupyter Notebooks, its an interactive way of developing and presenting data science projects, and I can really see that it’s an easy way to follow the code base for this project. It’s easy enough to install Jupyter Notebook on a machine too and well worth the install.

Plotting events on the field

There are a number of nice overviews of the structure of data given in the early part of the Notebook, but it’s more interesting when it comes to the static plots.

Figure 1: All Events Tottenham Hotspur 5 – 4 Leicester City, May 13, 2018.

Although of course too much detail can overwhelm and so the interactive plots in this Notebook are much better mechanism to share this information, as in you just have to hover the mouse over the event and its details come to the fore.

Figure 2: Pass Events Tottenham Hotspur – Leicester City, May 13, 2018.
 
Figure 3: Foul Events Tottenham Hotspur – Leicester City, May 13, 2018.
 
Figure 4: Fouls by a specific player Tottenham Hotspur – Leicester City, May 13, 2018.

This is a great Jupyter Notebook, firstly to really learn about Jupyter Notebooks, and then of course 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.

There’s more to come, as I plan to complete the match evolution, spatial stats in part II of this blog post and finally cover the advanced statistics: passing networks, flow centrality and playerRank in a part III of this blog post.

LOI Open day predictions not even close

March 21st, 2021

I laid it out there, with opening day predictions for the first set of fixtures for League of Ireland 2021, and not one, not even one came to pass.

By all accounts Drogheda were the better team in the Drogheda 1 vs 0 Waterford match.

I didn’t even come close in any of the other matches. Well I plan to use the same prediction model for the next 2 rounds, just to see if it’s a thing to have the league settle down, and also to evaluate what it is I’m missing from the prediction model.

Football opening day predictions for League of Ireland 2021

March 19th, 2021

The new season (2021) is just about to get underway for the League of Ireland and unfortunately I’m not quite ready with the full league table predictions, but I have got an early version of match prediction analysis software in place (details to follow at a later date) and so I’m going to take a quick look at my local team Waterford FC first and see what we have in store in this first league game against Drogheda United.

What a first match to pick, Waterford and Drogheda haven’t played against each other in the LOI Premier League since July 2007, a 3-0 home win for Drogheda, and with all of my data so far going back to 2012, I’m left a little stumped with having to go on to predict this one. There’s just a model of the home / away goal scoring rates in the LOI since 2012, so in using this the result pops out as:

The Probability of a Home win for Drogheda is 30%
The Probability of an Away win for Waterford is 45%
The Probability of a Draw between Drogheda and Waterford is 25%

Okay an away win for Waterford (maybe), let’s see what happens.

By the way it wasn’t that easy to find a dated version of LOI results from way back when, Whoscored ended up being the best source, with an honourable mention for Goal.

As for the other matches here are the predictions for the opening day

Shamrock Rovers (50%) vs St. Patricks (23%)
Draw (27%)

Finn Harps (24%) vs Bohemians (47%)
Draw (29%)

Longford Town (22%) vs Derry City (53%)
Draw (25%)

Sligo Rovers (24%) vs Dundalk (50%)
Draw (26%)

So wins for Shamrock Rovers, Bohemians, Derry City, Dundalk and Waterford FC for this opening day, let’s see how it pans out.