Have a personal or library account? Click to login
Getting NBA Shots in Context: Analysing Basketball Shots with Graph Embeddings Cover

Getting NBA Shots in Context: Analysing Basketball Shots with Graph Embeddings

Open Access
|May 2025

Figures & Tables

Figure 1

Left: Tracking data provided by SportsVU, Right: Video footage of Stephen Curry shooting a 3pt shot over Anthony Davis in a game of the Golden State Warriors against the New Orleans Pelicans
Left: Tracking data provided by SportsVU, Right: Video footage of Stephen Curry shooting a 3pt shot over Anthony Davis in a game of the Golden State Warriors against the New Orleans Pelicans

Figure 2:

Left: Spatio-temporal subgraph of tracking data from multiple time frames. Spatial edges are in grey (respective on the x and y plane), and temporal edges are in lime (in the time dimension). Right: Spatio-temporal graph for a game situation with seven frames before the shot. The red and blue nodes are for attackers and defenders, respectively. Green nodes are for the ball. Playerposition is annotated with their position (G: Guard, F: Forward, C: Center).Similar colored rings around the players indicate the players’ identity. Spatialedges are grey and indicate the distance between the nodes. The shooter nodehas an outline in magenta. Temporal edges are green and connect nodes from neighboring frames. The numbers indicate the temporal delay in time frames.
Left: Spatio-temporal subgraph of tracking data from multiple time frames. Spatial edges are in grey (respective on the x and y plane), and temporal edges are in lime (in the time dimension). Right: Spatio-temporal graph for a game situation with seven frames before the shot. The red and blue nodes are for attackers and defenders, respectively. Green nodes are for the ball. Playerposition is annotated with their position (G: Guard, F: Forward, C: Center).Similar colored rings around the players indicate the players’ identity. Spatialedges are grey and indicate the distance between the nodes. The shooter nodehas an outline in magenta. Temporal edges are green and connect nodes from neighboring frames. The numbers indicate the temporal delay in time frames.

Figure 3.

We can see the calibration probabilities in the main plot and the corresponding population of predicted probabilities in the top left detail box of the figure for the six differently trained models to predict the expected shot quality.
We can see the calibration probabilities in the main plot and the corresponding population of predicted probabilities in the top left detail box of the figure for the six differently trained models to predict the expected shot quality.

Figure 4.

Normalized values of the learned feature mask by the GNNExplainer model for the shot classification task with output node shooter and mean of all embeddings (orange). The graph shows the difference in importance for an average aggregate over all nodes, and the average shooter node.
Normalized values of the learned feature mask by the GNNExplainer model for the shot classification task with output node shooter and mean of all embeddings (orange). The graph shows the difference in importance for an average aggregate over all nodes, and the average shooter node.

Figure 5.

In the left frame, we can see the embeddings for the neural network predictions with a mean over different shooters with coloring in positions. The pure guards are colored in turquoise, the pure forwards are colored in pink, and the pure centers are colored in red. Guard-Forwards are colored in blue and the Forward-Centers are colored in green. On the right, the embeddings of every single situation are taken with coloring in 2-point (red) and 3-point shots (blue), both displayed with the TSNE-Embedding visualization.
In the left frame, we can see the embeddings for the neural network predictions with a mean over different shooters with coloring in positions. The pure guards are colored in turquoise, the pure forwards are colored in pink, and the pure centers are colored in red. Guard-Forwards are colored in blue and the Forward-Centers are colored in green. On the right, the embeddings of every single situation are taken with coloring in 2-point (red) and 3-point shots (blue), both displayed with the TSNE-Embedding visualization.

Figure 6.

Left: Shot of Serge Ibaka. Right: Shot from Blake Griffin. The attacking team is displayed in red with the shooter in magenta. The defending team is displayed in blue and the ball in dark green. Spatial edges are drawn in black/grey and temporal edges in lime. The thickness of the lines and nodes indicates the attention values, while the darker colour indicates the stronger attention of the network.
Left: Shot of Serge Ibaka. Right: Shot from Blake Griffin. The attacking team is displayed in red with the shooter in magenta. The defending team is displayed in blue and the ball in dark green. Spatial edges are drawn in black/grey and temporal edges in lime. The thickness of the lines and nodes indicates the attention values, while the darker colour indicates the stronger attention of the network.

Stephen Curry’s similarity measures compared_ Embedding Similarity (ours), RAPTOR, RAPM, averaged season statistics and the correlation coefficient of the weight matrix of the NMF_

RankEmbedding SimilarityRAPTORRAPMNormalized StatsNMF-weight-correlation
1K. Lowry (0.008)C. Paul (26)C. Paul (4.01)B. Beal (0.074)D. Augustin (0.85)
2Se. Curry (0.009)D. Wade (22)L. James (3.9)K. Irving (0.074)E. Gordon (0.80)
3P. Mills (0.011)L. James (20)D. Green (3.56)I. Thomas (0.077)Ryan Anderson (0.80)
4M. Williams (0.012)K. Leonard (18)R. Gobert (3.39)K. Walker (0.081)Jodie Meeks (0.79)
5D. Lillard (0.013)J. Harden (17)P. Patterson (3.33)D. Lillard (0.088)Ersan Ilyasova (0.78)

Features and number of players for each reference model_

PlayerPosition (x and y)Velocity (x and y)Acceleration (x and y)Basket (distance and angle)Nominal PositionHeight
Shooterxxxxxx
Closest Defenderxxxxxx
2.Closest Defenderxxxxxx

AUC, accuracy, F1-score, log-loss, Brier Loss and ECE for logistic regression, naive Bayes, gradient boosted classifier, multi-layer perceptron, GNN and GNN trained with Brier-loss_ Arrows point upwards (downwards) if a higher (lower) value represents better performance_

ModelAUC ↑Accuracy↑F1↑Log loss↓Brier loss↓ECE ↓
Logistic Regression0.59140.58610.61880.67270.23990.0294
Naïve Bayes0.57770.46990.61872.06780.42380.4887
Gradient-Boosted Classifier0.59890.58950.62050.66960.23840.0278
Multi-Layer Perceptron0.56900.578220.61870.79150.27120.1573
GNN - NII0.61020.60690.62450.66930.23790.073
GNN - Brier0.61740.60930.62590.65220.22870.0263

Hyperparameter boundary settings for the optimization of the baseline models via optuna_

ModelFrameworkHyperparameter
MLPsklearn
  • Layers: 1<x<6

  • Neurons: x<400

  • lr: 0.01>x>0.0001

GBCsklearnMax depth: 3<x<10, n_estimators: 10< x <200
NBsklearn-
Log. Reg.sklearn-
Language: English
Page range: 73 - 93
Published on: May 14, 2025
In partnership with: Paradigm Publishing Services
Publication frequency: 2 issues per year

© 2025 Marc Schmid, Moritz Schöpf, Otto Kolbinger, published by International Association of Computer Science in Sport
This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 License.