Valuing Actions and Ranking Hockey Players With Machine Learning (Extended Abstract)

A fundamental goal of sports analytics is to rank player performance. A common approach is to assign a value to each player action and rank a player by their aggregate action value. A recent AI-based approach is to measure the value of a player’s action by how much it increases their team’s chance of success, that is, their team’s chance of scoring the next goal. This requires a model that outputs a success probability estimate, given a match context and an action. This talk describes machine learning techniques for building success probability models from data. The techniques range from easy-to-implement probabilistic classifiers to advanced reinforcement learning methods. The results of success probability models are illustrated with action values and player rankings for the National Hockey League.


Introduction: Success Probabilities in Sports Analytics
During a match, each action by a sports team is directed towards maximizing the chance of future success. Therefore the probability of (future) success is a key statistical quantity for evaluating the strength of a team, the impact of an action, and the contributions of a player. This note accompanies a talk that shows how success probabilities can be used to value actions and ranking players, and describes techniques for estimating them from data.

Defining Success Probabilities
For the purposes of this note, success is flexibly defined as a binary event that a team seeks to bring about. An analyst is free to define success in different ways depending on the question they are investigating. Examples of success concepts that have appeared in the literature include the following (using hockey examples where possible).
• Scoring the next goal in the match [Routley and Schulte, 2015].
• Drawing the next penalty [Routley and Schulte, 2015]. This is a failure event that would be interesting to a coach who is concerned to minimize the number of penalties incurred by their team.
The notation denotes the probability that i achieves (future) success given the current match context X t . We discuss in Section 5.1 below how a context vector can be computed from play-by-play data.
A success probability is a dynamic quantity; a success probability ticker shows an estimated probability for each time in a match ; see Figure 1.

From Success Probabilities to Action Values
From success probabilities we can assign a value to actions called the impact of an action occurring at time t + 1 .
Thus the impact of an action is the difference in success probabilities before and after the action occurred. Figure 3 shows boxplots for impact values. Note that impact values can vary widely for the same action, depending on context.

From Action Values to Player Ranking
We can compute a player performance metric from impact values in a straightforward way: for each player, and for each of their actions, we can compute the impact of the action. The goal impact metric (GIM) is simply the total impact of the player's actions.
Our metric can be used to identify undervalued players. For instance, Johnny Gaudreau and Mark Scheifele drew salaries below what their GIM rank would suggest. Later they received a $5M + contract for the 2016-17 season.

Valuing Actions and Ranking Hockey Players With Machine Learning
Linköping Hockey Analytics Conference 2022 Figure 1: A success probability ticker for a match between the Penguins and the Blue Jacket. The y-axis shows the estimated probability of scoring the next goal.
While we do not have ground truth for evaluating player rankings, the goal impact player rankings have been validated indirectly in several ways.
2. GIM converges close to half-way through the season. This means that the beginning of the season can be used to evaluate player strength (predict the player's final ranking). ley, 2015ley, , Pettigrew, 2015, which is evidence that they measure a stable quality of players.

The GIM values per player correlate well across different seasons [Rout
The impact metric approach has also been validated in other sports, such as soccer [Decroos et al., 2019, Liu et al., 2020a, Fernández et al., 2021 and basketball [Cervone et al., 2014].

Learning Success Probability Models
Given the usefulness of success probability models, a major concern of machine learning for sports analytics is to develop machines for building such models from data. In the following I will discuss methods for building success probability models from event data, also known as play-by-play data. Estimating success probabilities from tracking data is less studied because tracking data is less

Valuing Actions and Ranking Hockey Players With Machine Learning
Linköping Hockey Analytics Conference 2022 Figure 2: Impact on the probability of Scoring the Next Goal. Higher numbers are better for the team that performs the action. Action Impact Values vary with context. The central mark is the median, the edges of the box are the 25th and 75th percentiles. The whiskers are at the default value, approximately 2.7 s.d. Based on the model of [Routley and Schulte, 2015].

Classifier Approach
A straightforward approach is to annotate each event at time t with a binary target Y i,t ∈ {0, 1} that denotes whether team i acting at time t achieved future success after time t. For example in the game of Figure 1, the Penguins scored around time t = 3, 900 sec. So for all previous times 2, 400 < t ′ < 3, 900, we would have Y Penguins,t ′ = 1 and Y Flyers,t ′ = 0. Then estimating success probabilities can be modelled as predicting a binary label given the information X t available at time t.
It is straightforward to include in the context vector X t values for time indexed features score differential, manpower differential, time remaining, location etc. [Routley andSchulte, 2015, Liu et al., 2018]. The main difficulty is how to include the match history prior to time t. A simple approach is to fix a window size k and then to append to X t the time-indexed features for the previous times t − 1, . . . , t − k. See [Decroos et al., 2019] for a model of this approach applied

Valuing Actions and Ranking Hockey Players With Machine Learning
Linköping Hockey Analytics Conference 2022 to soccer (they used k = 3 as the window size). After extracting the window information as context, the data will be a list of ⟨X t , Y i,t ⟩ pairs, which is the standard format for any classifier package available in systems like R, Weka, scikit-learn. An alternative to using a fixed window size is to apply a recurrent neural network, which can take as input a sequence without the need for preprocessing.

Reinforcement Learning
Reinforcement learning (RL) is the branch of machine learning that studies learning to act [Sutton and McCallum, 2007]. Estimating success probabilities from sequential data is one of the basic well-studied problems in RL. In RL, a mapping from match states to success probabilities is known as a value function and estimating a value function is called the prediction problem. The classifier approach described in the previous subsection (implicitly) treats all match states as independent, and hence ignores the correlations between success probabilities due to the temporal dynamics of ice hockey. In contrast, reinforcement learning seeks to exploit the temporal dynamics to efficiently learn success probabilities.
If we discretize the spatial rink coordinates, we can model hockey dynamics

Valuing Actions and Ranking Hockey Players With Machine Learning
Linköping Hockey Analytics Conference 2022 in a framework known as a discrete Markov decision process [Routley andSchulte, 2015, Schulte et al., 2017a,b]. The key parameters in a Markov decision process are state transition probabilities that describe what is likely to happen next in a hockey game. Given an estimate of state transition problems, the dynamic programming algorithm can be used to compute success probabilities for any match state. While discretization can simplify learning and in many cases increases the interpretability of success probabilities, it also loses information and introduces unnatural discontinuities in a success probability model. Reinforcement learning provides so-called model-free methods for learning success probabilities that do not require discrete state transition probabilities. Combining model-free methods with neural networks provides a method for learning success probabilities that can take as input continuous spatio-temporal data "as is" without the need for discretization or fixing a window size. Model-free deep RL has been developed in several recent approaches for sports dynamics [Liu et al., , 2020b. Figure 3 summarizes the options for learning success probabilities discussed.

Conclusion
Estimating success probabilities is a basic statistical problem in hockey analytics. A good success probability model can be leveraged to solve important analytics problems such as quantifying the value of an action and the contributions of a player. Machine learning models can include rich match contexts to provide useful success probabilities. Probabilistic classifiers based on a sliding window are relatively straightforward to implement and can serve as a strong baseline for evaluating the usefulness of success probabilities in an application. Reinforcement learning is especially suitable for handing complex dynamic domains like ice hockey and provides a powerful set of tools for increasing the complexity and accuracy of a hockey model.

Valuing Actions and Ranking Hockey Players With Machine Learning
Linköping Hockey Analytics Conference 2022