## 3 Methodology
### Automation of Pit Stop Decisions Using a Neural Network
#### 3.2.2 Pre-Processing  
Several filters are applied when fetching the data from the database: \begin{table}
\begin{tabular}{c l} \hline \hline
**FCY Status** & **Description** \\ \hline
0 & No FCY phase active \\
1 & First lap of a VSC phase active at the end of the lap \\
2 & Further laps of a VSC phase active at the end of the lap \\
3 & First lap of an SC phase active at the end of the lap \\
4 & Further laps of an SC phase active at the end of the lap \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Explanation of the full-course yellow (FCY) status feature. \begin{table}
\begin{tabular}{l l l l} \hline \hline
**Feature** & **Type** & **Value Range** & **Evaluation Point** \\ \hline Race progress & Numerical & [0.0, 1.0] & End of previous lap \\ Tire age progress & Numerical & [0.0, 1.0] & End of previous lap \\ Position & Categorical & \{leader, pursuer\} & End of previous lap \\ Relative compound & Categorical & \{soft, medium, hard\} & Current lap \\ Race track category & Categorical & \{1, 2, 3\} & – (constant) \\ FCY status & Categorical & \{0, 1, 2, 3, 4\} & Current lap \\ Remaining pit stops & Categorical & \{0, 1, 2, 3\} & Current lap \\ Tire change of pursuer & Categorical & \{true, false\} & End of previous lap \\ Close ahead & Categorical & \{true, false\} & End of lap before previous lap \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Input feature set for a neural network to take the pit stop decision. * Wet races are removed, since tire change decisions under such conditions are mainly based on driver feedback and track dampness (which is not included in the data available to us). This is also the reason why wet compounds were not included in the input feature set. * Data relating to drivers making more than three pit stops in a race are removed, as already explained. * Data relating to drivers making their final pit stop after a race progress of 90% are removed. Such pit stops are either made in the event of a technical problem or due to the new rule in the 2019 season that states that the driver with the fastest lap time is awarded an extra championship point (if he also finishes within the top 10). Since the car is lightest shortly before the end of a race (due to the burned fuel), there is the best chance for a fast lap time. Accordingly, drivers who are so far ahead towards the end of a race that they would not drop a position by making a pit stop can afford to stop and get a new set of tires. However, we did not want the NN to learn this behavior, since it is specific to the current regulations. * Data relating to drivers with a lap time above 200 s or a pit stop duration above 50 s are removed. Such cases occur in the event of technical problems, damage to the car, or interruption of the race. * Data relating to drivers with a result position greater than ten are removed. This is done in order to train the NN on successful strategies only. Of course, a finishing position within the top ten is no guarantee of a good strategy. However, as top teams have more resources, we assume that they tend to make better decisions. This does not introduce bias into the training data, since there are no features in the set that would subsequently be underrepresented, as would be the case with team names, for example. Applying all the filters results in 62,276 entries (i.e., laps) remaining. The earliest race data presented to the NN are from the end of the first lap. This is because some features, such as the ahead value, are not available before the start of the race. Consequently, the first pit stop decision can be taken for lap two. However, as pit stops in the first lap are not generally made on the basis of worn tires but due to technical problems, this does not cause any issues. Further on in the process, specified test races are separated from the data to exclude them from the training. Then, the pre-processor removes the mean and normalizes the range of numerical features. Categorical features are one-hot encoded.