## 3 Methodology
### Analytical Model for Labelling the Dataset  
Objective of this model is to develop a labelled set of switch and trap plays identified from the tracking data to be used as a training set. For this purpose, the analytical model encodes contextual knowledge about basketball defense as described in Section 2. A basketball game consists of two teams each with five players. The team that possesses the ball at any given time is considered the offensive team, and the team without the ball is considered the defensive team. Typically, each defensive player selects one matched offensive player to defend. An experienced player, coach or spectator can identify the correspondence between players (who is defending whom) based on the position of players. The objective of this algorithm is to understand the defensive relationship between the players of the two teams based on the player tracking data. This model underpins the overarching aim of this study by enabling the classification of defensive strategies in basketball. The analysis of the underlying relationship between in-game players needs to be a team-level analysis rather than a specific player-level analysis. Determining the one-on-one defensive relationship between players will act as the foundation of the proceeding classification model building. The analytical model is based on three different attributes: the location data at each time step, the distance between players, and the defensive zone of players. The structure of the proposed analytical model is illustrated in Figure 4.  
Firstly, in terms of the location at each timestep, a data example means a possession and a possession consists of many consecutive time-steps. In addition, the interval between each time step is 0.16 s (6.25 Hz). Through processing the raw data, we obtain the location of all the ten players at a given timestep. Utilising these location data it is possible to calculate the velocity of each player. The velocity is utilised to identify the similarity of movement of two players at consecutive time-steps. Secondly, the model utilises the distance between players. The offensive player who is closest to a particular defensive player has a high probability of being the defensive target (match) of the defender. A good defense requires the defensive player to place a lot of pressure on the opponent, therefore in this process, defensive players usually approach the defensive target to block the movements. Additionally, in some situations, if an offensive player has a low offence threat, the defending opponent of this offensive player may keep a farther distance. For example, if an offensive player is far from the three-point line, and the long-range shooting ability is poor, the defender of this offensive player may keep a long distance between them. In this scenario, while the defensive player would be distant from the offensive player, they would still, most likely, position themselves between the offensive player and the basket. Once the offensive player approaches the basket, the attack success rate will increase, which also means a greater threat to the defensive team. Therefore, this system adds a feature that identifies the offence route of the offensive player to further inform the defensive relationship. When there is no defender around an offensive player, the system will connect the straight line between the offensive player and the basket because the straight path of the player to the basket is the shortest and most threatening path. Finally, the analytical model utilises the notion of a 'defensive zone' of players, which separates the basketball court into five zones. The area of each defensive zone is evenly distributed according to the distance between players. The method to identify defensive zones, will calculate the distance from each point on the grid to the five defensive players when constructing the defensive zone of the defensive players. Next, the nearest defensive player is assigned to a given point (x, y location) on court.