Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌀 Add NBA tracking data support #5

Open
UnravelSports opened this issue Oct 25, 2024 · 0 comments
Open

🌀 Add NBA tracking data support #5

UnravelSports opened this issue Oct 25, 2024 · 0 comments

Comments

@UnravelSports
Copy link
Owner

🏀 Add NBA tracking data support

The NBA-Player-Movements repository contains a full seasons' worth of NBA tracking data.

The general outline of this implementation should follow the existing American Football (BigDataBowl) implementation, because it has a Polars back-end.

  • Create a basketball folder in unravel
  • Create a BasketballDataset class that supports both a string parameter to directly load a single 7zip file from the specified url, and a game identifier (in the repository they use Celtics@Lakers for example, not sure if this is optimal if we want to load all games, one by one).
  • This dataset class should help us load the data with Polars (see BigDataBowlDataset) and internally convert it to the correct format, and field dimensions. This requires a BasketballPitchDimensions class.
  • It also requires a row-wise Polars dataframe with a similar structure to the BigDataBowl data (ie, 1 row per player, per frame with game_id, frame_id, team, player, x, y at a minimum).
    I'm not exactly sure what variables are available in the existing dataset, so we might need to add speed, vx, vy or direction of travel, team in possession or a way to infer the closest player to the ball as we do in the soccer converter etc. It doesn't have to follow the exact formatting of the BigDataBowl dataset, but it's a good reference point.
  • We'll also need a BasketballGraphSettings class to store any settings.
  • Finally we'd need a BasketballGraphConverter class to help us convert into Graphs. Again, this requires a similar approach as the AmericanFootballGraphConverter. Perhaps some parts can be refactored into a parent class.
  • Add the relevant imports to the relevant __init__.py files
  • Add tests for all functionality see the tests folder for reference.

This implementation requires some research into the existing code, because I don't know if the data has on-ball events that might be useful for label creation, an attacking team flag etc.

@UnravelSports UnravelSports changed the title [Implemenatation Idea] 🏀 Add NBA tracking data support [Idea] 🏀 Add NBA tracking data support Oct 25, 2024
@UnravelSports UnravelSports changed the title [Idea] 🏀 Add NBA tracking data support 🌀 Add NBA tracking data support Oct 25, 2024
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

No branches or pull requests

1 participant