# Prediction of Flight Delays at _Beijing_ Capital International Airport Based on Ensemble Methods
## 4 Case Study  
### Data Description  
Due to COVID-19, the numbers of flights at most airports around the world dropped significantly [29]. Therefore, we used data from 2019 to indicate flight operation conditions after the epidemic is over. PEK is a hub airport and its passenger volume reached 100 million in 2019, ranking second globally [30]. To train our model and validate its predictive performance, we used PEK flight records from 1 January 2019 to 31 January 2020, obtained from CAAC. In this paper, flight records from PEK to HGH are presented as a case study. Our dataset comprised a total of 640,555 flight records, including all arrival and departure flights. Key fields included flight number, airline, aircraft register number, take-off and landing time, delays, etc. Delays were positive or negative, with a negative number indicating that the actual time was earlier than the scheduled time, which can have a significant impact on actual operations and is therefore within the scope of this paper. Figure 2 depicts the distribution of flight delays after removing the top and bottom 1% of delay values. Figure 2: Cumulative distribution of flight delays. Note that approximately 10% of flights had negative delay values, among which nearly 80% were arrival flights. Figure 3 shows that the arrival flight delays had higher quartile values and outliers than departure flights, and arrival flights had more negative delay values. Airlines sometimes overstate flight times to create a buffer for unpredictable events, resulting in negative delay values [20]. While this overstatement may offset delays caused by other factors, it can affect the accuracy of predictions. Thus, to avoid such errors, we focused on departure flights. In Figure 4a, the abscissas for the airline are airline codes assigned by the International Civil Aviation Organization (ICAO). There were significant differences in the distribution of flight delays between airlines. The figure shows only the distribution of delays for the top 10 airlines separately in terms of flight volume. There were four aircraft capacity classes in our dataset, and class 3 had the highest average delay, see Figure 4b. As shown in Figure 4c, when the delay of previous flight was greater than 50 min, the delay of current flight also increased, indicating that the current flight was likely to be affected by the delay of the previous flight. Figure 4: _Cont._  
Figure 3: Quartile diagram of arrival and departure flights; (**a**) arrival flights, (**b**) departure flights. As Figure 5a shows, when the air temperature was between \(-10\) and \(20\)\({}^{\circ}\)C, the distribution of delay was more stable and concentrated. The average delay increased when the temperature was between \(20\) and \(40\)\({}^{\circ}\)C. Although low temperatures may cause flight delays due to icing of the runway, there were no extreme delay values in this dataset, having possibly been removed as outliers during data preprocessing. As indicated in Figure 5b, the average delay was higher when the atmospheric pressure was lower, which may be due to the relationship between atmospheric pressure and weather. For example, atmospheric pressure is lower during bad weather, such as on rainy days compared with sunny days. When horizontal visibility is low, such as in severe haze, flights are delayed for safety reasons. Similarly, high wind speeds are not conducive to safe take-off and landing, resulting in increased average delays. Figure 4: Factors influencing flight attributes: (**a**) airline, (**b**) aircraft capacity class, (**c**) delay of previous flight. Figure 5: Influencing factors relating to weather: (**a**) air temperature, (**b**) atmospheric pressure, (**c**) wind speed, (**d**) horizontal visibility. In Figure 6a, 0 indicates 00:00-00:59 and 23 is 23:00-23:59. In Figure 6b, the digits 1-7 indicate Monday to Sunday, respectively. In Figure 6c, 1-12 refer to January to December, respectively.