{'fraction_non_alphanumeric': 0.029177189950817493, 'fraction_numerical': 0.00790907882493686, 'mean_word_length': 4.66296575084682, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Basketball Player's Value Evaluation by a Networks-based Variant Parameter Hidden Markov Model

Determining the value of basketball players through analyzing the players' behavior is important for the managers of modern basketball teams. However, conventional methods always utilize isolated statistical data, leading to ineffective and inaccurate evaluations. Existing models based on dynamic network theory offer major improvements to the results of such evaluations, but said models remain imprecise because they focus merely on evaluating the values of individual players rather than considering them within their current teams. To solve this problem, we propose an analysis and evaluation model based on networks and a hidden Markov model. To the best of our knowledge, we are the first to combine a network form representing the players who are playing with the use of a hidden Markov model to mine the network and generate the desired results. Applying our approach to SportVU data collected from the National Basketball Association shows that this analysis and evaluation model can effectively analyze the performance of each player in a game and provides an assistive tool for team managers.


Introduction
Behavioral analysis of basketball players and the measurement of their values are crucially important for building an admirable basketball team. Without an elaborate assessment system for basketball players, the team manager is unable to devise a strategy by which to utilize athletes of different types and values [1]. Such a system can not only provide suggestions for team managers for formulating strategies but also play important roles in the construction of coaching tactics and in the players' own training.
Conventional systems often use concrete statistical data, such as scoring, assists, and rebounds, to measure player's behavior in a game. On the basis of these data, they study the changes in individual players' physical states in competition and try to divide the players' roles in team sports (such as a leading role versus a supporting role), so as to orient themselves to their players' values [2][3][4]. By Svensson's survey report [5], such an approach has been proven insufficient insofar as it ignores implicit abilities behind direct data and cannot offer proper strategies by which to improve the total performance of a team with unaltered players. The appearance of the camera on the game court provides opportunities accurately analyzing any specific player in detail. For example, SportVU [6], which is dedicated to the domain of sports, distinguishes concrete ball passing and records the instantaneous positions of each player. The massive amounts of data produced by similar recording systems enable theoretical analyses with mathematical tools, such as graph theory and hidden Markov modeling, to uncover useful information that can correctly assess players' values.
The players in the games can initially be viewed as isolated points that are connected by ball passing and changing position to form an integrated network, which match the attributes of the network. The first attempt of sports analysis was proposed by Gould and Gatrell [7], who studied the simplicial complexes of the passing network in the 1977 FA Cup Final. However, their analysis did not receive considerable attention due to the limitations of hardware facilities.
Since the mid-2000s, a series of works have appeared. These works introduced social networks to analyze team sports. Bourbousson et al. [8] presented an efficient method for distinguishing the relationships among basketball players on the offensive end using graph theory. Passos et al. [9] provided some insights on graph theory in team sports by analyzing datasets of player interactions during an attacking sequence in water polo. In 2012, Fewell et al. [10] introduced a transition graph in basketball games wherein the vertices indicated the five traditional player positions (point guard, shooting guard, small forward, power forward, and center). In this paper, the network properties of degree centrality, clustering, entropy, and flow centrality across teams and positions were used to characterize the game. These results prove that the coordination of players built on local interactions does not necessarily force all players to win the matches. Despite this result, Duch et al. [11] still applied the network model to improve the passing accuracy and analysis performance of soccer players. Recently, a series of works by Clemente et al. [12,13] demonstrated that network metrics can be applied to characterize the cooperation of players, which is a powerful tool for helping coaches understand specific properties of their teams and to support decision making to improve the sports training process based on match analysis.
These achievements provide the basis with which to utilize graph theory to evaluate the individual values of players. Indeed, the researchers [13][14][15] evaluated the performance of players by network density and heterogeneity. However, it is challenging to evaluate players' exact values on their own team [16]. The challenge is that players produce a large amount of data when they interact on the court, and the quantitative analysis of this information cannot be achieved by these scholars' methods [17]. To solve this problem, we use the interactive data between players to construct the network and then apply a machine learning algorithm to analyze these networks.
We introduce a novel criterion to better discover and analyze datasets for evaluating the exact value of a player to his team. This criterion combines three features of players that match the actual situation in a game. The estimation of each player's three features with a machine learning algorithm is the key to analyzing his value to the team. The first feature includes passing efficiency and its specific effect on scoring, which indirectly measures the scores that one player achieves. The second feature involves the probabilities of a person being chosen as an organizer for the next offense. It offers the ability to form an overarching perspective of a player in a game. The last feature is the direct scoring generated by a player, which includes foul shots and three-point shots. Under the novel criterion, we construct a passing network that incorporates the semantics of the game to create an accurate expression of the passing relationship between players to quantify these three features by means of three parameters. The state transition probability indicates the passing relationships, the initial probability represents the probability of a player being chosen as an organizer, and the observation probability illustrates the probabilities of different points that the player scores in a round. To estimate these three parameters, we propose a variant parameter hidden Markov model (VPHMM), which is a parameter estimation paradigm that inherits advantages from hidden Markov models [18][19][20].
The main contributions of this paper include the following: • A novel criterion is introduced to evaluate the player's performance from a team-level perspective.
• A variant parameter hidden Markov model is proposed to estimate the parameters that indicate three features of the player's performance.
• A network-based hidden Markov model is applied to team sports for the first time.
The rest of the paper is organized as follows. We describe in detail the methods in Section 2, which includes network analyses and parameter estimation. In Section 3, the results of the measures are empirically demonstrated. Section 4 is the conclusion.

Methodology
We originally aimed to record and analyze passing networks in basketball to evaluate the exact value of each player to his team. However, because most sources only provide aggregate data across all games, the passing networks were constructed using the parameters trained in our system. When we found that the system, which was created by a hidden Markov model, could train very accurate parameters, we discovered that the evaluation method exceeded our expectations. All three parameters obtained by the algorithm can play an important role in the network, which is composed of detailed data with which the game players are constructed [21]. The subtle performances of a player on the court can be shown by his three parameters. We applied these parameters to basketball games to demonstrate that the approach is feasible and precise in evaluating the value of a basketball player to his team.

Network Analyses
To characterize the basketball matches as a network, the first step is to define the standards by which the players are linked. We construct a finite n×n network where the vertices represent the players and the edges represent linkages between players (e.g., when a player passes the ball to another player). A 'round' can be defined as the moment that the team obtained possession of the basketball to the moment when possession of the basketball was recovered by the opposition [9]. Then, the contribution of a player to a team can be inferred from the individual passing network and, in particular, from centrality and statistical measures, which define the values of a player according to different parameters [15]. We provide a novel measure that defines three parameters and discusses their meaning in the context of basketball.
Definition 2.1. (Matrix of state transition probability). Assume that there is a set of players M = {1, 2, ..., m}; we define ω i,j to be the number of passes from player i to player j. Thus, the total number of passes in a game should be m i=1 ω i . Therefore, the matrix of transition probability A can be solved as follows: • For every player i ∈ M, • The player did not pass the ball if i = j.

Definition 2.2. (Matrix of observation probability).
Assume that there is a set of observations N = {1, 2, ..., n}; we define b j,k to be the number of players j in observation k. Thus, the total observations of this player in a game should be n j=1 b j,k . Therefore, the matrix of transition probability B can be solved: • For every observation of basketball game k ∈ N . Definition 2.3. (Initial probability distribution). We define π as the probability distribution of players being chosen as an organizer for the offense.
We generated weighted graphs from the probabilities of cumulative passes, which can be obtained from the definition 2.1. Here, previous researchers [10] usually set m to five letters to represent the five most important players of five basketball positions. Although this better depicts the network diagram by highlighting the important players per the role of the network, it ignores the values of role players. This may distort the truth of the game, and the result will be different from the actual event. The network diagram (see Figure 1) that we set up here does not ignore any one person. The blue circles represent those involved in the match who had playing time. An arrow's direction represents the pass direction. The origin of the arrow indicates the player who passed the ball, and the arrowhead indicates the player who received the ball. The width and color of the arrows denote the numbers and percentages of passes from one player to another during games. Specifically, thicker arrows represent more passes taking place between players, and thinner arrows illustrate fewer passes occurring among players. The red arrows represent when the number of passes from one player to a specific player is more than 20 percentage of his total passes. When the percentage is between 10 and 20, the arrows are colored orange. Meanwhile, the blue arrows represent when this percentage falls between 5 and 10, and the green arrows denote that ,this percentage is between 1 and 5. The grey arrows represent percentages of less than 1, the minimum percentage. This weight graph not only takes into account the details but also intuitively reveals the important players in the game. However, when our dataset was analyzed in detail, almost all nodes were connected, making some nodes difficult to differentiate across the team's network. To The blue circles represent the players involved in the game who had playing time. The direction of the arrows represents the pass direction. The origin of the arrow indicates the player who passed the ball, and the arrowhead indicates the player who received the ball. The width and color of the arrows denote the numbers and percentages of passes from one player to another during games. Specifically, thicker arrows represent more passes having occurred between players, and thinner arrows indicate fewer passes having occurred among players. The red arrows indicate that the number of passes from one player to the specified player is more than 20 percent of his total passes. When the percentage is between 10 and 20, the arrows are colored orange. Likewise, the blue arrows indicate that this percentage is between 5 and 10, and the green arrows indicate that this percentage is between 1 and 5. The gray arrows indicate that the percentage is less than 1, which is the minimum percentage represented by color. solve this problem, we creatively refined the graph ( Figure 2) to each player's perspective. Each player's individual network contains the passes arrows and received arrows. Upon evaluating the values of the players, these individual networks can intuitively indicate the relevance or centrality of a player. In addition, the method of evaluation also includes the score distribution of the player. The score distribution defines the probability of different numbers of points scored by the player in a round. The last parameter we used in our method represents the probability of the player being the organizer. These three parameters trained in our system represent the aforementioned features. We will illustrate the application in detail in Section 3 with an example about basketball.

Parameters Training
In the definitions of the previous subsection, we defined the following parameters: the matrix of transition probability A = {a ij }, the matrix of observation probability B = {b ij }, and the initial probability distribution π = {π i }. We provide the definitions and mathematical procedures of our VPHMM algorithm in this subsection.
We define the players to be the finite set of states M = {α 1 ,α 2 ,α 3 ,...,α m }, and we define the finite set of observations N ={Γ 1 ,Γ 2 ,Γ 3 ,...,Γ n }. These two parameters, which are easily obtained from the large datasets, are used as input for Algorithm 1 to estimate the other three parameters (i.e., A, B, and π). Now, we present a practice example to show how the proposed algorithm works.
Algorithm 1 was proposed based on a very classical unsupervised learning algorithm in the hidden Markov model [22]. We combine the estimation method with the properties of network theory to train the parameters and evaluate the players' values in the basketball matches. The estimation formula, which incorporates the semantics of the basketball game [23], is as follows: In the method, a ij denotes the probability of player i passing to another player j. We calculate a ij as follows: b j (k) (n+1) represents the probability of player j obtaining b points in one round. Its estimation formula is π (n+1) i represents the rate of player i being chosen as the organizer, and the parameter can be trained from According to [24], γ t (i) as a conclusion is defined as follows: where α t (i) and β t (i) are two intermediate variables. Both of these variables converge from one side to another and construct a directed edge to form a recursive structure.
ζ t (i, j) is an intermediate node in the t round, which is derived from the forward algorithm [25], calculated by the formula with the last node. It can be obtained as follows: The weighted and directed edge relation , P (i t = q i , i t+1 = q j , O|λ) between rounds can be calculated as follows: Then, we present their derivation in detail based on the games of the Golden State Warriors in the 2016 season. In our set, we have the known observation sequence O = (o 1 , o 2 , o 3 , ..., o T ) and o T ∈ N . The states' sequence is I = (i 1 , i 2 , i 3 , ..., i T ) and i T ∈ M. In our method, the observation sequence O presents a sequence of rounds in the basketball match, and T represents the number of rounds in a game. The states' sequence is illustrated as the player. In our example, A is Stephen Curry, and B is another player named Andrew Bogut. λ presents the current estimate (i.e., the parameter's value when the game is in progress). The λ are parameters that the team most want to see. Based on these, we obtained the following: In the case study, P (O|λ) can be directly calculated from the initial original data. According to algorithm [24] in the HMM, we developed Q(λ, λ) by utilizing the known values, which is Thus, three parameters have occurred in the formula. We deduce the values of these parameters as follows: (1) π i : through the above calculations, we obtain In the basketball matches, someone is always chosen as an organizer in a round. Consequently, π i satisfies the following constraints: By using the Lagrange multiplier method, the Lagrange function is written as Take the partial derivative and make it 0.
We can obtain the following: Then, we sum over i and obtain γ γ = −P (O|λ).
We can obtain π i as (2) a ij : it is the same as π i . We sum over the probability that a player's pass in a game is 1, satisfying the constraint N j=1 a ij = 1.
By using the same method as (13), we obtain (3) b j (k): the derivation process is the same as (2),

Experiment and Results
We present the results of the computation of the methods for all games played by the Golden State Warriors and Cleveland Cavaliers in the 2016 season of the National Basketball Association (NBA). There are two reasons for choosing these two teams in this season. First, they were the most consistent teams in the league in recent years, and they did not change any aspects of their regular rotation during this season. Second, these two teams won all three championships during the past three years. According to common sense [26], we consider the Finals to be the environment that best shows the players' true characteristics and their value to their team. Furthermore, we can also analyze more players' data and reduce the volatility caused by changes in the lineup [27]. More importantly, through rigorous mathematical derivations, we can compare the actual parameters for which we used real data from the finals, with the parameters trained in our system, to verify the accuracy of the training system that we obtained. Due to page limitations, we only analyze some games, which are randomly selected from all competitions, and we evaluate the exact values of two players (Stephen Curry and Andrew Bogut) in this paper. The results of other games and players are presented in the appendix .

Data
The data for all games in the 2016 season of the NBA were downloaded from the SportVU website. SportVU is an optical tracking system installed by the NBA on all 30 courts to collect real-time data [28]. We generate a sequence of points based on rounds, and we also present the data for each team as a table (Table 1 shows 20 games for the Cleveland Cavaliers). In addition, we introduce artificial passing data (namely, Table 2 shows the number of passes for the Cleveland Cavaliers), which include the Finals from the 2015 and 2016 seasons, to verify the parameters' effectiveness.
We set up a Java web project to show all of our results. The passing network and graph were created and analyzed using Java and NetworkX [29]. The code implementation of the algorithm was created using Python. The table is processed from the data of a part of our appendix.

CaseStudy
In this section, through a verification experiment, we will prove that the proposed method, which combines networks with a hidden Markov model, is a feasible approach. The experimental results are more accurate and stable for evaluating the exact values of basketball players.
In this experiment, we have 13 players recorded during the season for the Golden State Warriors, for whom are incorporated the semantics of the basketball games. Now, we indicate them with letters (e.g., A represents Stephen Curry). Each round is given a set of 4 results (0 points, 1 point, 2 points, and 3 points). Thus, we set the known parameters in the model as follows: M = {A, B, C...L, M }. N = {0, 1, 2, 3}. The observation sequence O i of our selected games is inputted into the algorithm. We can obtain the parameters A (matrix of state transition probability), B (matrix of observation probability), and pi (initial probability distribution). According to the above analysis, the parameters that were not directly obtained from the original large dataset can be derived from the algorithm in our system. By using these parameters, we provide a novel behavior analysis and individual evaluation method in the basketball game. Now, we combine the method with the data from the basketball competition and introduce the experiment in detail from two perspectives.

Method 1. The method for verifying the accuracy of the parameters trained in VPHMM
It is well known that in hidden Markov models, if the parameter of a state transition matrix probability is the same, the other two parameters are the same. This is determined by its derivation formula. [25]. In other words, if we prove that the parameters A (matrix of state transition probability), which is a training parameter, is the same as its defined parameter, which is generated by the actual numbers, then we can verify the effectiveness of the parameters trained by the system. To obtain the parameters in the definitions, we obtained the passing data for the NBA Finals in 2015 and 2016 through artificial collection (such as Table 1). In this way, we can calculate the metric of state transition probability from its definition and compare the results with those trained by our system. Moreover, we have a graphical processing [30] for showing the data intuitively. Fig 3 illustrates the probability that players X and Y interact (i.e., passing the ball to each other) in four games. The more interactions that occurred among players, the lighter is the color displayed in the grid, as displayed in the reference scale on the right-hand side of each grid. There are eight pictures here, each of which is composed of 13 × 13 grayscale lattices. They are divided into 4 groups. Both figures in one group are printed to describe the same game, whose parameters are calculated in two different ways. The top row is the result of the real observation, and the bottom row is the result of our algorithm. By comparing and analyzing the data from the four groups (see Fig 3), it can be observed that deviation of the parameters is in the acceptable range [31]. In our experiment, we carefully compared all the game parameters of different teams in the 2016 and 2017 NBA Finals. Thus, we can consider that parameters trained in our system are applicable and the method of training parameters is feasible.

Method 2. A novel criterion to evaluate the exact values of players.
Duch et al. [11] proposed that evaluating any network of a team requires determining the relative value of its individual members. In the same way, the value of a player also depends on the network of his team. The network here is directly determined by the interaction between players on the basketball court. To solve this problem in a comprehensive way, we propose a novel criterion about basketball by quantifying the involvement of players in the network and calculating the probability distribution of their points and the probability that the player was chosen as an organizer with successful versus unsuccessful results. For our analyses, we used the parameters that were trained from our algorithm to compare the different players. We provide the methodology to evaluate the exact values of players and illustrate its concrete steps with two players (i.e., Stephen Curry and Andrew Bogut) of the Golden State Warriors.
Through the 2016 season. In our Methodology, we have defined the parameters A, B, and π. Now, we visualize each of the parameters to obtain the values of the players in the comparison. From the data visualization, the matrix of transition probability is indicated as a weighted graph (Fig 1), the matrix of observation probability is shown as a pie chart (Fig  4), and the initial state probability distribution is expressed as a bar chart (Fig 5). In the case study, we randomly choose two games of the Golden State Warriors to evaluate Stephen Curry's and Andrew Bogut's exact values to the team [32]. For the purpose of evaluating the exact values of Stephen Curry and Andrew Bogut of the Golden State Warriors, we generate the network representation for every game involving the Golden State Warriors. Figure 1(a) is one of the games chosen randomly among the Warriors' wins. Meanwhile, Figure 1(b) is one of the games chosen randomly among the Warriors' losses. In this paper, we take these two games, combined with the three features of the parameters, as the examples suggest. Before the units of each parameter, we first compare two weighted graphs. There is a clear difference in the density of passes between the successful games and the lost game. This provides an important reference for our next analysis. The evaluation method is instantiated in the parameters as follows: 1. By using data from the matrix of transition probability, we creatively construct the individual weight graphs, which show each player's linkages from the player's point of view. Figure 6 shows the networks of Stephen Curry; we can observe that the networks are very different between the successful game and the lost game. We analyze the results of the game from two perspectives.
• According to the comparison between the two games, we can observe that when the game is won, the probability of Curry's passed balls and received balls are more balanced with all his teammates. In the lost games, he was more inclined to interact with several core players. In other words, his interaction with his teammates is very important to the game.
• In addition, whether the game results are wins or losses, Stephen Curry can contact almost all of the players. Figure 7 presents the network of another Golden State Warriors' player named Andrew Bogut. Clearly, we can intuitively see that his passed arrows and received arrows in the two games are both less than those of Stephen Curry. We can observe that this player prefers to obtain the received balls, which means that this player is more dependent on assists from his teammates than on creating an opportunity for himself [33].
2. From the data visualizations, the matrix of observation probability was presented as a pie chart. This pattern showed the significance of Stephen Curry to the team. Comparing the two charts (i.e., Figure 4a and Figure 4c), we can intuitively see a great difference in the performance of Stephen Curry between the two games. When he did not play at his proper level (e.g. , Fig 4c), the probability of losing the game was larger. It was also observed that Andrew Bogut's performance in the two games was almost identical (see Fig 4b and Fig 4d). 3. According to the initial probability distribution, we transformed the probability distribution into a bar chart. The chart shows the probability of players in the game being the organizer of each round. By analyzing Fig 5, we can analyze the probability changes of all players (e.g., Stephen Curry and Andrew Bogut) during the different games. In Fig 5a and Fig 5b, the X-axis represents each player, and the Y-axis indicates the probability that a player is chosen as the organizer. By analyzing the two histograms, we can obtain a clear conclusion. For the team, Stephen Curry is the organizer who the team relies on in every game. Moreover, through the comparison of probability, a higher proportion of passes involving Stephen Curry is propitious to the game's success. By contrast, the proportions of the other players (e.g., Andrew Bogut) are relatively small and have little influence.
We drew some interesting conclusions by comparing the two players in the two different games. All players from different teams can be added to the comparison in this way. From the results, it was possible to visually identify the differential influences of the performances of various players on the result of the game. The quantification and visualization of the value of a player to his team can provide coaches and managers with useful knowledge for deciding on the roster of their teams.

Conclusion
In this paper, we presented an approach to evaluate the exact values of basketball players to their team using SportVU data collected from the NBA. For this purpose, we first defined and trained three parameters, depending on the passing network, the probabilities for a person being chosen as an organizer, and the distribution of the player's scores. To verify the effectiveness of the parameters trained in the system, we used a mathematical derivation for the formula to estimate the parameters and calculate the deviation between the output results of the algorithm and the real data. We accomplished this by using an algorithm called the variant parameter hidden Markov model (VPHMM), which was used to analysis the players' networks. To obtain better evaluation performance, we respectively visualized the three parameters as a weighted graph, a pie chart, and a bar graph. The overall goal of this work was to create an assistive tool for the manager of the teams, coaches, and players to use when planning to improve the team and play against an upcoming opponent. The experiment showed that our method of evaluating basketball players' values in teams is superior to previous strategies. We believe this method can play a role in other group sports.