Is it possible to defend against Messi? A data perspective.

June 3, 2020 ยท View on GitHub

Python code associated to my blog post about Messi: Is it possible to defend against Messi?.

Content

This repo contains code for analysing Messi Data Biography.

It contains folders for Jupyter notebooks, data, and figures.

Notebooks

My analysis is composed of several notebooks. You can find the complete list below, with a small description.

NotebooksDescription
01-data_loadingLoad Statsbomb data from local or github and do some preprocessing.
02-data_explorationExplore Messi data and visualize some stats (goals, winning %, etc.)
03-Defense_analysisFocus on the question "How to defend against Messi?". Exploration of Espanyol-Barcelona 2009/2010
04-VAEP_with_atomic-spadlUse atomic-spadl to use the VAEP metric
05-xT_with_atomic-spadlUse atomic-spadl to use the xThreat metric
06-EXTRA-advanced_messi_statsData vizualisation of some advance metrics
atomic-spadl_1-load-and-convert-statsbomb-dataNotebook from atomic-spadl
atomic-spadl_2-compute-features-and-labelsNotebook from atomic-spadl
atomic-spadl_3-estimate-scoring-and-conceding-probabilitiesNotebook from atomic-spadl
Utility_functionsUtility functions for data vizualisation and calculate advance stats
unit_testTest of one utility function with pytest

N.B.: make sure the atomic folder of socceraction is at the same level as this project if you want to use the associated notebooks.

Interactive visualization

List of visualization.

General

All static images can be found here: https://github.com/BenjaminLarrousse/statsbomb-messi/tree/master/figures

VisualizationDescription
Win/draw/loss FC BarcelonaWin/draw/loss distribution of FC Barcelona with Messi (2004-2019).
Win/draw/loss MessiWin/draw/loss distribution depending on Messi scoring or assisting.
Messi goals and assistsNumber of games with goal, assist, or both.
Goals and assists involvementPercentage of games without goals or assists, by season.
Messi xG distributionDistribution of xG depending on goals or assists.
Messi VAEP values by seasonMessi VAEP outputs by season.
VAEP distributionVAEP distribution on the complete Messi dataset.
VAEP vs xGCorrelation between xG and VAEP for Messi.

Derby Espanyol/Barcelona

All static images can be found here: https://github.com/BenjaminLarrousse/statsbomb-messi/tree/master/figures/derby

VisualizationDescription
VAEP Distribution (2009/10)VAEP distribution, season 2009/10, and derby value.

Messi Advanced stats

VisualizationDescription
Completed passes inside the boxMessi completed passes inside the box, normalized per 90. By season.
Completed passes into the boxMessi open play completed passes into the box, normalized per 90. By season.
Completed throughballsMessi completed throughballs, normalized per 90. By season.
Key passesMessi open play key passes, normalized per 90. By season.
xG assistedMessi xG assisted, normalized per 90. By season.

Contact

For further information, please contact me on Twitter: @BLarrousse