Skip to content

Comments

[FEAT] Pressing Intensity and Polars improvements#9

Merged
UnravelSports merged 2 commits intomainfrom
feat/pressing-intensity
Feb 15, 2025
Merged

[FEAT] Pressing Intensity and Polars improvements#9
UnravelSports merged 2 commits intomainfrom
feat/pressing-intensity

Conversation

@UnravelSports
Copy link
Owner

This pull request accomplishes the following:

  • Deprecated SoccerGraphConverter in favor of SoccerGraphConverterPolars. This will be removed in the future.
    • note: This currently means the Graph features are slightly different.
    • note: This means, for the time being, we have node_features_pl.py, edge_features_pl.py and adjacency_matrix_pl.py alongside the non-polars ones.
  • Introduced unravel.soccer.PressingIntensity
  • Removed necessity for Polars datasets to .load(). This is now called within __init__.
  • Introduced settings dataclass into Polars datasets (BigDataBowlDataset and KloppyPolarsDataset).
class DefaultSettings:
    home_team_id: Union[str, int]
    away_team_id: Union[str, int]
    provider: Union[Provider, str]
    pitch_dimensions: Union[MetricPitchDimensions, AmericanFootballPitchDimensions]
    orientation: Orientation
    max_player_speed: float = 12.0
    max_ball_speed: float = 28.0
    max_player_acceleration: float = 6.0
    max_ball_acceleration: float = 13.5
    ball_carrier_threshold: float = 25.0
  • Introduced Constant, Column and Group dataclasses to more easily track which columns we are using under the hood.
class Constant:
    BALL = "ball"

class Column:
    BALL_OWNING_TEAM_ID = "ball_owning_team_id"
    ....

class Group:
    BY_FRAME = [Column.GAME_ID, Column.PERIOD_ID, Column.FRAME_ID]
    ....
  • Fixed Orientation.BALL_OWNING_TEAM messing up our velocity and acceleration calculations.
  • Speed up Polars further by using unnest().
  • Updated examples
  • Updated tests

@UnravelSports UnravelSports merged commit 71b8161 into main Feb 15, 2025
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant