Domain Concepts
The kloppy.domain module defines entities that reflect real-world concepts within the domain of soccer match data. These entities serve as the framework upon which kloppy's logic is structured. The domain concepts are arranged hierarchically. At the highest level, kloppy defines the concept of a Dataset. Each dataset is linked with a Metadata entity, which holds all external information that describes the dataset.
Dataset
A Dataset describes specific aspects of what happened during a single match as a sequence of DataRecord entities. Kloppy defines three main types of match datasets: EventDataset, TrackingDataset, and CodeDataset.
First, we describe the entities related to each of these three dataset types. Next, we discuss the structure of the metadata.
EventDataset
An EventDataset is a chronologically ordered sequence of Event entities. Each Event represents an on-the-ball action (e.g., pass, shot, tackle) or tactical change (e.g., substitution) and is annotated with a set of attributes that describe the event:
- an
EventType, - a
Timewhen the event happened, - a
Teaminvolved in the event, - the
AttackingDirectionof the team executing the event, - the ball owning
Team, - a
Playerinvolved in the event, - a
Pointon the pitch where the event happened, - the
BallStateduring the event, - a list of
Qualifierentities providing additional details, and - optionally a tracking data
Frame.
Depending on the EventType, an event can have additional attributes.
TrackingDataset
A TrackingDataset is a sequence of Frame entities. Each frame describes the locations of the ball and the players as a Point on the pitch at a particular Time.
CodeDataset
A CodeDataset is a sequence of Code entities, each representing a tagged event within a match.
Metadata
A Metadata object contains all external information describing the match: two Team entities that describe the line-ups of both teams, the Period entities that describe the start and end times of each period of the match, the final Score, the Provider that collected the data, the Orientation (i.e., playing direction) of both teams, and the CoordinateSystem in which locations are defined.