| --- |
| language: |
| - en |
| license: mit |
| task_categories: |
| - time-series-forecasting |
| tags: |
| - temporal-point-process |
| - event-sequences |
| - nba |
| - sports |
| - play-by-play |
| - marked-temporal-point-process |
| size_categories: |
| - 1K<n<10K |
| pretty_name: NBA Quarter Events |
| dataset_description: >- |
| Curated per-quarter NBA play-by-play sequences from the 2024-25 regular season, |
| designed for temporal point process (TPP) and marked temporal point process (MTPP) |
| modeling. Each sequence represents one quarter (Q1-Q4) of a single game, with the |
| prediction target being the play type of the next event. Sequences are filtered to |
| keep only quarters with 90-110 events, ensuring consistent sequence lengths. Rich |
| narrative type_text descriptions provide fully descriptive context — shot style and |
| distance, make/miss results, offensive/defensive rebound classification, full team |
| names on every event, and timeout types — enabling an LLM to predict the next event |
| type from the sequence alone. Quarter and time information are captured in metadata |
| and time_since_start fields rather than repeated in type_text, reducing token waste. |
| --- |
| |
| # NBA Quarter Events |
|
|
| ## Dataset Description |
|
|
| Curated per-quarter NBA play-by-play sequences from the 2024-25 regular season, designed for temporal point process (TPP) and marked temporal point process (MTPP) modeling. Each sequence represents one quarter (Q1–Q4) of a single game, with the prediction target being the **play type** of the next event. Sequences are filtered to keep only quarters with 90–110 events, ensuring consistent sequence lengths. |
|
|
| Rich narrative `type_text` descriptions provide fully descriptive context for each event — shot style and distance, free throw make/miss with sequence position, offensive/defensive rebound classification, team identification on every play, and timeout types — enabling an LLM to predict the next event type from the sequence alone. Quarter and time-remaining information is not repeated in `type_text` since it is already captured in `metadata.quarter` and `time_since_start`. |
|
|
| - **Source:** [NBA Stats API](https://www.nba.com/stats/) |
| - **Season:** 2024–25 Regular Season |
| - **Grouping:** Events grouped by quarter (Q1–Q4) within each game |
| - **Sequences:** 2,868 |
| - **Train / Validation / Test:** 2,296 / 286 / 286 |
| - **Sequence length:** 90–110 events per quarter (mean: 101.5) |
| - **Total events:** 291,091 |
| - **Event types:** 9 play categories |
| - **Time unit:** minutes (from quarter start) |
| - **Source games:** 1,225 |
|
|
| ## Dataset Summary |
|
|
| | Property | Value | |
| |---|---| |
| | Total sequences | 2,868 | |
| | Train / Validation / Test | 2,296 / 286 / 286 | |
| | Event types | 9 | |
| | Total events | 291,091 | |
| | Events per quarter | 90–110 (mean 101.5) | |
| | Time unit | minutes (from quarter start) | |
| | Duration per quarter | 11.2–12.0 minutes | |
| | Season | 2024-25 Regular Season | |
| | Source games | 1,225 | |
|
|
| ## Schema |
|
|
| Each record follows the canonical 8-field TPP schema: |
|
|
| | Field | Type | Description | |
| |---|---|---| |
| | `seq_idx` | int | Sequence index (per split) | |
| | `seq_len` | int | Number of events in the sequence | |
| | `description` | str | Game summary (teams, date, quarter, player rosters) | |
| | `metadata` | str (JSON) | `game_id`, `home_team`, `away_team`, `home_players`, `away_players`, `game_date`, `season`, `season_type`, `time_unit`, `quarter` | |
| | `time_since_start` | list[float] | Elapsed minutes from the first event in the quarter | |
| | `time_since_last_event` | list[float] | Minutes since the previous event (first is 0.0) | |
| | `type_event` | list[str] | Play type label — the prediction target | |
| | `type_text` | list[str] | Rich narrative description of each event | |
|
|
| ## Event Types (9 categories) |
|
|
| | type_event | Description | Share | |
| |---|---|---| |
| | `rebound` | Offensive and defensive rebounds | 24.3% | |
| | `missed_fg` | Missed field goals (2pt or 3pt) | 22.4% | |
| | `made_2pt` | Made 2-point field goals | 13.8% | |
| | `free_throw` | Free throw attempts (make/miss) | 8.9% | |
| | `foul` | Personal, shooting, and offensive fouls | 8.3% | |
| | `made_3pt` | Made 3-point field goals | 7.0% | |
| | `turnover` | Turnovers (bad pass, travel, shot clock, etc.) | 6.7% | |
| | `steal_or_block` | Steals and blocked shots | 5.9% | |
| | `timeout` | Team timeouts (regular, mandatory) | 2.6% | |
|
|
| Administrative events (substitution, jump ball, period start/end, violation, ejection, instant replay) are excluded. |
|
|
| ## type_text (Rich Narrative) |
| |
| Each event's `type_text` is a natural language sentence combining multiple context signals. The description is designed to be **fully informative** so an LLM reading a sequence of events can predict the next event type: |
|
|
| - **Player identity**: Name, team full name, position (guard / forward / center) |
| - **Team identification**: Full team name on every event (e.g., "for the Orlando Magic") for unambiguous possession tracking |
| - **Shot style**: Specific shot type from API subType (driving layup, fadeaway jump, pullup jump, cutting dunk, etc.) |
| - **Shot distance & zone**: Distance in feet from the API `shotDistance` field, plus court zone (paint, left wing, corner three, top of arc, mid-range, etc.) |
| - **Free throw detail**: Make/miss result parsed from description, plus sequence position (e.g., "1 of 2", "2 of 3") |
| - **Rebound classification**: Offensive or defensive, classified via subType and description parsing (covers ~95%+ of rebounds) |
| - **Timeout team & type**: Team identified via `location` field (home/visitor), with timeout subtype (regular, mandatory) |
| - **Foul subtype**: Lowercased foul type (shooting, personal, offensive, loose ball, etc.) |
| - **Score context**: Leading team, margin, game state (tight game, comfortable margin, blowout) |
| - **Momentum**: Scoring runs with full team name (e.g., "Orlando Magic currently on a 6-0 scoring run"), pattern signals (e.g., "shooting 3 for 5 recently") |
|
|
| **Examples:** |
|
|
| ``` |
| # Made 2pt — includes shot style, distance, zone, team name |
| "J. Robinson-Earl. makes a 2-point putback layup from 3 feet near the basket |
| for the New Orleans Pelicans. Orlando Magic lead 12-6. early in the game." |
| |
| # Made 3pt |
| "K. Ware, Heat center. makes a 3-point jump from 28 feet from the right wing |
| for the Miami Heat. Milwaukee Bucks lead 81-65 with a comfortable margin." |
| |
| # Missed field goal — includes 2pt/3pt distinction and shot style |
| "J. Robinson-Earl. misses a 2-point layup from 6 feet in the paint for the |
| New Orleans Pelicans. The game is tied. early in the game." |
| |
| # Free throw miss — includes make/miss and sequence position (1 of 2) |
| "J. Alvarado, Knicks guard. misses free throw 1 of 2 for the New Orleans |
| Pelicans. The game is tied." |
| |
| # Rebound — classified as offensive/defensive |
| "G. Bitadze, Magic center-forward. grabs an offensive rebound for the Orlando |
| Magic. The game is tied. early in the game." |
| |
| # Turnover — subtype integrated naturally into description |
| "B. Ingram, Raptors forward. commits a bad pass turnover for the New Orleans |
| Pelicans. The game is tied. early in the game." |
| |
| # Foul — lowercased subtype |
| "F. Wagner, Magic forward. commits a personal foul for the Orlando Magic. |
| The game is tied. early in the game." |
| |
| # Steal |
| "K. Caldwell-Pope, Grizzlies guard. records a steal for the Orlando Magic. |
| The game is tied. early in the game." |
| |
| # Timeout — team identified with full name, includes timeout type |
| "the New Orleans Pelicans call a regular timeout. The game is tied. early in |
| the game. Orlando Magic currently on a 6-0 scoring run." |
| ``` |
|
|
| ## Curation Filters |
|
|
| Quarters are selected from complete games (all 4 regulation quarters present) with diverse, non-trivial event distributions: |
|
|
| | Filter | Value | Description | |
| |---|---|---| |
| | `min-events` | 90 | Min events per quarter | |
| | `max-events` | 110 | Max events per quarter | |
| | `min-types` | 4 | At least 4 distinct event types of 9 | |
| | `max-dominant-ratio` | 0.40 | No single event type exceeds 40% of events | |
| | `max-repeat-ratio` | 0.30 | Consecutive same-type rate below 30% | |
| | Completeness | — | All 4 quarters (Q1–Q4) must be present; overtime excluded | |
|
|
| ## Example |
|
|
| ```json |
| { |
| "seq_idx": 0, |
| "seq_len": 96, |
| "description": "NBA Regular Season game between the New York Knicks and the Brooklyn Nets on 2025-04-13. Q1 play-by-play events. New York Knicks: C. Payne, L. Shamet, M. Bridges, ...; Brooklyn Nets: D. Timme, K. Johnson, T. Etienne, ...", |
| "metadata": "{\"game_id\": \"0022401188\", \"home_team\": \"BKN\", \"away_team\": \"NYK\", \"home_players\": [\"D. Timme\", ...], \"away_players\": [\"C. Payne\", ...], \"game_date\": \"2025-04-13\", \"season\": \"2024-25\", \"season_type\": \"Regular Season\", \"time_unit\": \"minutes\", \"quarter\": \"Q1\"}", |
| "time_since_start": [0.0, 0.3167, 0.5333, ...], |
| "time_since_last_event": [0.0, 0.3167, 0.2167, ...], |
| "type_event": ["foul", "turnover", "made_2pt", ...], |
| "type_text": [ |
| "M. Bridges, Knicks guard-forward. commits a personal take foul for the New York Knicks. The game is tied. early in the game.", |
| "commits a shot clock turnover. The game is tied. early in the game.", |
| "C. Payne, 76ers guard. makes a 2-point driving finger roll layup from 5 feet in the paint for the New York Knicks. New York Knicks lead 2-0 in a tight game. early in the game.", |
| ... |
| ] |
| } |
| ``` |
|
|
| ## Data Source |
|
|
| Play-by-play data sourced from the NBA Stats API via the [`nba_api`](https://github.com/swar/nba_api) Python package using the `PlayByPlayV3` endpoint. Player metadata (name, position, team) fetched via `CommonPlayerInfo`. |
|
|
| ## Usage |
|
|
| ```python |
| from datasets import load_dataset |
| |
| ds = load_dataset("DescribeEvents/nba_quarter_events") |
| |
| # Access splits |
| train = ds["train"] # 2,296 sequences |
| val = ds["validation"] # 286 sequences |
| test = ds["test"] # 286 sequences |
| |
| print(train[0]["type_event"][:5]) # First 5 play types |
| print(train[0]["type_text"][:5]) # First 5 narrative descriptions |
| ``` |
|
|
| ## Citation |
|
|
| If you use this dataset, please cite: |
|
|
| ```bibtex |
| @dataset{nba_quarter_events_2025, |
| title={NBA Quarter Events: A Temporal Point Process Dataset}, |
| author={DescribeEvents}, |
| year={2025}, |
| publisher={Hugging Face}, |
| url={https://huggingface.co/datasets/DescribeEvents/nba_quarter_events} |
| } |
| ``` |
|
|