Classify and value on-ball football actions using SPADL and VAEP
Project description
Silly Kicks
Comic by NanoBanana — inspired by Monty Python's Ministry of Silly Walks
The Ministry requires that all football actions be properly classified and valued.
silly-kicks is a Python library for objectively quantifying the impact of individual actions performed by football players using event stream data.
It is an independently maintained successor to socceraction, originally developed by Tom Decroos and Pieter Robberechts at KU Leuven. Built under the MIT license with full attribution preserved.
Features
- SPADL -- Soccer Player Action Description Language: a unified schema for on-ball actions with converters for StatsBomb, Wyscout, Opta, and kloppy
- VAEP -- Valuing Actions by Estimating Probabilities: a framework for quantifying the value of individual actions
- Atomic SPADL -- continuous (non-discretized) action representation
Installation
pip install silly-kicks
Requires Python 3.10 or later.
With optional provider support:
pip install "silly-kicks[kloppy,xgboost]"
Quick Start
import silly_kicks.spadl as spadl
# Convert StatsBomb events to SPADL actions
actions, report = spadl.statsbomb.convert_to_actions(events, home_team_id=123)
# Add human-readable names
actions = spadl.add_names(actions)
VAEP Workflow
The full pipeline: convert provider events to SPADL, train a VAEP model, and rate individual actions.
from silly_kicks.spadl import statsbomb
from silly_kicks.vaep import VAEP
# 1. Convert provider events to SPADL
actions, report = statsbomb.convert_to_actions(
events_df, home_team_id=home_team_id,
xy_fidelity_version=2, shot_fidelity_version=2,
)
# 2. Train a VAEP model
model = VAEP(nb_prev_actions=3)
features = model.compute_features(game, actions)
labels = model.compute_labels(game, actions)
model.fit(features, labels, learner="xgboost", random_state=42)
# 3. Rate actions
ratings = model.rate(game, actions)
# Returns DataFrame with offensive_value, defensive_value, vaep_value
Hybrid-VAEP
Standard VAEP includes the action's result (success/fail) as a feature, which creates information leakage. HybridVAEP removes result information from the current action while preserving it for previous actions.
from silly_kicks.vaep import HybridVAEP
# HybridVAEP removes result leakage from current-action features
model = HybridVAEP(nb_prev_actions=3)
# Same fit/rate API as standard VAEP
Multi-Provider Support
All converters share the same output schema, so downstream code works identically regardless of the data provider.
from silly_kicks.spadl import opta, wyscout
actions_opta, _ = opta.convert_to_actions(opta_events, home_team_id)
actions_wyscout, _ = wyscout.convert_to_actions(wyscout_events, home_team_id)
Architecture
Open docs/c4/architecture.html in a browser to explore the C4 architecture diagrams (System Context, Containers).
Attribution
This project builds on the foundational research by the KU Leuven Machine Learning Research Group. If you use this library in academic work, please cite the original papers:
@inproceedings{Decroos2019VAEP,
title = {Actions Speak Louder than Goals: Valuing Player Actions in Soccer},
author = {Tom Decroos and Lotte Bransen and Jan Van Haaren and Jesse Davis},
booktitle = {Proceedings of the 25th ACM SIGKDD International Conference
on Knowledge Discovery \& Data Mining},
pages = {1851--1861},
year = {2019},
doi = {10.1145/3292500.3330758}
}
@inproceedings{Decroos2020AtomicSPADL,
title = {Interpretable Prediction of Goals in Soccer},
author = {Tom Decroos and Jesse Davis},
booktitle = {Proceedings of the AAAI-20 Workshop on Artificial Intelligence
in Team Sports},
year = {2020}
}
Contributing
See CONTRIBUTING.md for development setup, coding standards, and PR process. Open items and planned work are tracked in TODO.md.
License
MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file silly_kicks-1.0.2.tar.gz.
File metadata
- Download URL: silly_kicks-1.0.2.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6ad9b8309c68d48c792c9cc671408ac7048931a8d1566f7caf6b891e26c5db6
|
|
| MD5 |
8464d9f8dcc884f32ec086a7871f7956
|
|
| BLAKE2b-256 |
7490cf3f718ecba414f1799dceb2ba2956a2b02b3ca9830007c3587296b55d5b
|
Provenance
The following attestation bundles were made for silly_kicks-1.0.2.tar.gz:
Publisher:
publish.yml on karsten-s-nielsen/silly-kicks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
silly_kicks-1.0.2.tar.gz -
Subject digest:
f6ad9b8309c68d48c792c9cc671408ac7048931a8d1566f7caf6b891e26c5db6 - Sigstore transparency entry: 1247669608
- Sigstore integration time:
-
Permalink:
karsten-s-nielsen/silly-kicks@bd4269b0161be44d543dff5d5461daa87f59ffbf -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/karsten-s-nielsen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bd4269b0161be44d543dff5d5461daa87f59ffbf -
Trigger Event:
push
-
Statement type:
File details
Details for the file silly_kicks-1.0.2-py3-none-any.whl.
File metadata
- Download URL: silly_kicks-1.0.2-py3-none-any.whl
- Upload date:
- Size: 63.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
632e81741380c86ee507b2e789d1b986cdcdb585b9a6ff07431103052968126c
|
|
| MD5 |
e4aee6e6ddaf62000f44ddb01da542dd
|
|
| BLAKE2b-256 |
8f3c099a88a6e65bec75690e0ec6b784e3ec41623e002811053797e0418c3e73
|
Provenance
The following attestation bundles were made for silly_kicks-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on karsten-s-nielsen/silly-kicks
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
silly_kicks-1.0.2-py3-none-any.whl -
Subject digest:
632e81741380c86ee507b2e789d1b986cdcdb585b9a6ff07431103052968126c - Sigstore transparency entry: 1247669616
- Sigstore integration time:
-
Permalink:
karsten-s-nielsen/silly-kicks@bd4269b0161be44d543dff5d5461daa87f59ffbf -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/karsten-s-nielsen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@bd4269b0161be44d543dff5d5461daa87f59ffbf -
Trigger Event:
push
-
Statement type: