## 3 Methodology
### Dataset  
SportVU tracking data, provided by STATS LLC, was utilised [35]. The dataset contains basketball player trajectory data obtained from the NBA. Each data file represents a possession. Possession is a sequence of game events during which one team retains the ball and ends when the ball is captured by the opposing team, or if a shot at the basket is made [33]. Possession is an essential efficiency statistic because it allows statistical analysis based on a per-possession basis. The dataset obtained from [36] consists of possessions of variable length: each possession is a sequence of tracking coordinates (\(s^{i}_{t}=x^{i}_{t}\,y^{i}_{t}\)) for each player \(i\), recorded at 25 Hz, where one team has continuous possession of the ball. The possessions last between 50 and 300 frames. The dataset obtained contains 36,330 possessions are taken from the STATS SportsVU tracking data from the 2012-2013 NBA season. These data have come from approximately 630 games. It should be noted that in the original study that used this data [36], 80,000 possessions were analysed along with the event data, of which only the 36,330 possessions are made publicly available, and excludes the associated event data. Of the 36,330 possessions, only 32,377 possessions were used in our study.  
All the data frames were standardized in-to attack-defense situations, regardless of the side of the court the activity is happening. Therefore, all activity can be analysed as taking place from one half of the court. The proposed method to identify defensive zones, utilises a \(400\times 360\) row-major grid to represent a basketball half court. For each time step, the player and ball positions are stored as serial indices in a \(400\times 360\) grid representation of the half-court, indexed row-major, with \((0,0)\) in the top-left [33]. The dataset utilised in this study, is provided only for half-court, and hence cannot be used for analysing defensive strategies such as full court presses.  
The objective of the paper was to use machine learning to automatically classify switch and trap by analysing the player and ball tracking data, and for this the labelled data need to be provided. An analyst should ideally go through the individual frames of a possession in sequence to recognise if there was a switch or trap. However, this was a very time-consuming task to label all the possessions. Therefore, we developed an analytical model that is explained in Section 3.2 to analytically identify and label parts of possessions that contain a switch or a trap. The analytical model selects 5 frames at a time from a possession and analyse if there is a switch or trap in the possession. Not all the possessions in the dataset will contain a switch or a trap, and notice that some possessions will contain more than one occurrence of switch/trap. Finally, a total of 42,865 plays of switches and traps were identified from 32,377 possessions.  
144 possessions of this data set that contained a switch or trap strategy was manually selected and annotated with an appropriate label by one researcher. These manually labelled possession data are used for identifying the reliability of the analytical model.