floodlight.models

Collection of data models grouped by category. Each submodule contains model classes that provide data analysis methods based on core objects. Inspired by the scikit-learn API, each model class contains a .fit(...)-method that ‘fits’ the model to the data.

All Available Models

kinematics.DistanceModel

Computations for Euclidean distances of all players.

kinematics.VelocityModel

Computations for velocities of all players.

kinematics.AccelerationModel

Computations for velocities of all players.

geometry.CentroidModel

Computations based on the geometric center of all players, commonly referred to as a team's centroid.

kinetics.MetabolicPowerModel

Class for calculating Metabolic Power and derived metrics from spatiotemporal data.

space.DiscreteVoronoiModel

Calculates discretized versions of the Voronoi tessellation commonly used to assess space control.

For quick reference, the following computations are available after calling the respective model’s .fit(...)-method

Geometry

CentroidModel.centroid

Returns the team centroid positions as computed by the fit method.

CentroidModel.centroid_distance

Calculates the Euclidean distance of each player to the fitted centroids.

CentroidModel.stretch_index

Calculates the Stretch Index, i.e., the mean distance of all players to the team centroid.

Kinematics

DistanceModel.distance_covered

Returns the frame-wise distance covered as computed by the fit method.

DistanceModel.cumulative_distance_covered

Returns the cumulative distance covered.

VelocityModel.velocity

Returns the frame-wise velocity as computed by the fit method.

AccelerationModel.acceleration

Returns the frame-wise acceleration as computed by the fit method.

Kinetics

MetabolicPowerModel.metabolic_power

Returns the frame-wise metabolic power as computed by the fit()-method.

MetabolicPowerModel.cumulative_metabolic_power

Returns the cumulative metabolic power.

MetabolicPowerModel.equivalent_distance

Returns frame-wise equivalent distance, defined as the distance a player could have run if moving at a constant speed and calculated as the fraction of metabolic work and the cost of constant running.

MetabolicPowerModel.cumulative_equivalent_distance

Returns cumulative equivalent distance defined as the distance a player could have run if moving at a constant speed and calculated as the fraction of metabolic work and the cost of constant running.

Space

DiscreteVoronoiModel.player_controls

Returns the percentage of mesh points controlled by each player of the first and second team.

DiscreteVoronoiModel.team_controls

Returns the percentage of mesh points controlled by the first and second team.

DiscreteVoronoiModel.plot

Plots the fitted mesh grid colored by team controls for a given time point on a matplotlib axes.

DiscreteVoronoiModel.plot_mesh

Plots the generated mesh on a matplotlib.axes.