Skip to main content

Implementation of the construction of Markov models representing the offensive style of play of soccer teams, and analysis based on these models.

Project description

Markovsoccer

Markovsoccer is a Python package to construct and inspect team models representing the offensive behaviour of soccer teams. In particular, it provides a function to build a team model based on event stream data of that team. This model represents their ball possession sequences. The team model is able to capture the sequential nature of the game and has the ability to generalize over the historical actions that a team has performed in the past. This package implements the calculation of several numerical features to analyze the playing style of teams based on these models. These features are related to a team's preference for certain locations, their preference for certain sequences, their directness of play, and their ability to create shooting opportunities.

Core Features

  • Construct Team Models: implementation of a function to construct team models based on the (vendor-independent) SPADL event stream data format.
  • Analyze Playing Style: implementation of several numerical features to analyze the offensive playing style of soccer teams based on these team models.

Installation

The recommended way to install this package is using pip. The latest version officially supports Python versions 3.8 - 3.10.

pip install markovsoccer

The public-notebooks folder contains several demos to get started.

Benefits of the Team Model

The use of the intermediate team models to analyze the playing style of teams has two advantages:

  • It captures the sequential aspect of the game.
  • It has the ability to generalize over the historical actions that a team has performed in the past.

Overview of the Team Model: The figure below provides an overview of the states and transitions of the team model. Each transition is associated with a team-dependent probability. This probability is equal to the historical frequency of the corresponding action by that team.

Generalization: The generalization ability stems from the assumption that if a team has a high likelihood of moving the ball from position A to B, and also a high likelihood of moving the ball prom B to C, then this team is assumed to also have a high likelihood of consecutively moving the ball from A to B to C. This assumption allows the model to derive new ways how a team can score a goal, arrive at a shot, or move the ball to a particular location. This is done by interleaving historical ball possession sequences. By doing so, it is hypothesized that analysis of the playing style based on the model is more reliable. As an example, playing style analysis based on raw event stream data only has a small number of shots and goals which can be analyzed, leading to skewed results. However, analysis based on the model can take into account (tens of) thousands of ways to arrive at a shot or score a goal, each which their own probability. This leads to a more all-encompassing view and less skewed results.

The figure below visualizes the generalization ability. Imagine a first sequence representing a goal as in the left image. Then image a second sequence ending in a ball loss as in the middle image. The model will then be able to derive a new way how a team can score a goal by interleaving these two sequences. The resulting sequence is shown in the right image.

Probabilistic Model Checking: The team model is a discrete-time Markov chain and can be used for probabilistic model checking. In particular, this package provides functionality to write each team model to disk as a PRISM file for use in the PRISM model checker. Examples can be found in the public-notebooks folder.

Research

If you use this package in your research, please consider citing the following paper:

  • Clijmans, Jeroen, Maaike Van Roy, and Jesse Davis. Looking Beyond the Past: Analyzing the Intrinsic Playing Style of Soccer Teams. European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases ECML PKDD 2022, 2022. [ pdf | bibtex ]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

markovsoccer-0.1.2.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

markovsoccer-0.1.2-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file markovsoccer-0.1.2.tar.gz.

File metadata

  • Download URL: markovsoccer-0.1.2.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.9.6 Windows/10

File hashes

Hashes for markovsoccer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7c7b940a2aa8dc605928ce8259d40060466d47b3f8aef7443cd6d75aeefb353b
MD5 40c9ca25eb7f2d4c4615916dc58b9494
BLAKE2b-256 ce96199f7cf91392ce349f3d963a174593bb52c3b3a04ae3388274de00254c3c

See more details on using hashes here.

File details

Details for the file markovsoccer-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: markovsoccer-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.9.6 Windows/10

File hashes

Hashes for markovsoccer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7e91b8fadbe9d451f8d1c573a2f1a1d7039c6a92ab9a6a6a36aaae1e5628d7a8
MD5 cfbe7b5a60ed71945ba23a185ce8d384
BLAKE2b-256 b00948012e1c62baf46fb50dacd39d450f1a6b78e698c70bdcbf144f57b6cbd0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page