Research on the Prediction of Flight Passenger Flow in Holidays based on Machine Learning

This article focuses on predicting holiday flight passenger flow to optimize airline resource allocation. Analyzing daily passenger data during key holidays, including New Year’s Day, Qingming Festival, Labour Day, Dragon Boat Festival, Mid-Autumn Festival, and National Day, the study employs four machine learning models: Random Forest, Multilayer Perceptron, LightGBM, and Stacking. Findings reveal that all models effectively capture holiday flow patterns, with LightGBM demonstrating superior prediction accuracy. Moreover, creating unified models for all holidays outperforms individual holiday-specific models. The study delves into the factors influencing the varying performance of the best model across different features, providing insightful analysis and discussion.


Introduction
The rapid expansion of China's social economy has significantly boosted the civil aviation industry, sparking fierce competition among airlines despite opening up new opportunities in the aviation market.Consequently, airlines are increasingly adopting revenue management strategies to boost earnings and trim costs.In this domain, forecasting passenger traffic stands as a pivotal element [1].Accurate predictions not only empower airlines to take strategic actions like adjusting flight frequencies or changing aircraft types for better passenger load optimization but also enable them to tailor services to meet travelers' needs effectively.This emphasis on precise passenger flow forecasting holds immense practical value in enhancing daily operations and elevating the overall quality of civil aviation services.Unlike the passenger flow that changes periodically on regular days, the passenger flow on holidays tends to change significantly in a short period (see Figure 1), which makes it more important for airlines to forecast the passenger flow and adjust the capacity to meet the travel demand on holidays.At the same time, such short-term dramatic fluctuations can make forecasting more complex.So, how to make more accurate forecasts of flight passenger flow during holidays has become the important issue for each airline and is also the problem and challenges faced by this paper.In transportation research, studies on predicting passenger flow during holidays primarily concentrate on rail transportation.Xia Qing [2] approached holiday traffic forecasting by addressing two aspects: the fluctuation coefficient and predicting demand on regular days, applying this method to forecast railroad passenger flow from Guangzhou to 28 other cities.Xia-Ling Cao [3] proposed a combined ARIMA-SVR model specifically for short-term passenger volume forecasting during holidays, validated through Xi'an city's urban rail network.Xia-Feng Ji [4] introduced an LSTM-SVR prediction model to enhance accuracy in traffic flow forecasts during National Day.However, scant attention has been given to passenger flow during holidays in air transportation studies, with most focusing on air routes.Fan Wei [5] proposed a combined prediction algorithm for forecasting passenger flow on air routes during both regular days and holidays, demonstrating its superiority over single models in comparison tests.Zhu Qian [6] developed two distinct models to predict air route passenger flow separately for regular days and holidays, selecting the best-performing models through comparative analysis.Consequently, there's a noticeable gap in relevant research concerning the prediction of flight flow during holiday periods.
In terms of passenger flow prediction methods, Ren Peng [7] and Kanavos A. [8] used traditional time-series models such as ARIMA and ARIMAX to predict passenger volume.Qian-Qian Bai [9] obtained the index prediction value of the Elman neural network and used a multiple linear regression model to predict the passenger volume of branch line airports.The model was able to achieve a highaccuracy prediction result.Li JIE [10] constructed an LSTM neural network model to predict the daily passenger flow of Beijing-Guangzhou high-speed railway stations.Wu X [11] et al. constructed a twolayer model with SARIMA, CNNLSTM, XGBoost for parallel learning in the first layer and multiple linear regression in the second layer, which achieved better results.Thus, traditional time series and machine learning prediction methods are more widely used in passenger flow prediction.In this study, machine learning is preferred over traditional time-series forecasting methods due to its suitability for the forecasting scenarios at hand.Unlike regular days, holidays exhibit a fluctuation pattern in passenger flow characterized by abrupt and significant changes within short periods.This unpredictability renders traditional time series prediction methods, reliant on periodic trends, unsuitable for holiday traffic.Additionally, employing time series forecasting necessitates organizing data into sequences based on flights, but factors like air route adjustments and aircraft type changes can constantly alter flight elements.Moreover, historical data for entirely new flights is unavailable.Consequently, this paper omits the use of time series forecasting methods.Instead, machine learning focuses on flight-specific features, allowing predictions to generalize across flights sharing similar characteristics.Furthermore, it addresses the challenge of constructing historical data for these flights.Hence, this study employs machine learning methods to predict daily flight passenger flow during holiday periods.
With this study, we address the following research questions:  Which approach is more accurate, modelling each holiday individually or all holidays together?
 How do we construct suitable features to characterize this prediction scenario? Among the machine learning methods chosen for this paper, which one is more suitable for the prediction scenario? Is there a difference in the prediction error of the best model on different holiday features?
What is the reason?

Multilayer Perceptron
A Multilayer Perceptron is a type of feedforward neural network that comprises an input layer, a hidden layer, and an output layer.The signal flows from the input layer to the output layer via the hidden layer, and there is no feedback throughout the network.The output values of the neurons in each layer are calculated using equation (1).
() represents the output of the neuron at layer .() stands for the weight matrix governing the connections from layer -1 to layer .() is the bias associated with the connections.(•) is the activation function of the neuron at layer .

Random Forest
Random Forest stands as an integrated algorithm, belonging to an extended form of the bagging technique, comprising multiple decision trees known as weak learners, or CARTs.Each weak learner is trained using randomly selected samples and features, ensuring a diverse and robust model.This inherent randomness often negates the need for pruning, leading to enhanced generalization and resilience against overfitting.In regression tasks, the model consolidates predictions from multiple weak learners by averaging their outputs, culminating in the final model prediction.

LightGBM
LightGBM operates as an ensemble algorithm rooted in Gradient Boosting Decision Trees (GBDT).This approach employs an additive model, constructing several Classification and Regression Trees (CARTs) sequentially.In GBDT, this additive model similarly builds multiple CARTs in series, with each round focused solely on fitting the residuals of the preceding model.The prediction values of each CART are summed to obtain the final result.However, higher data dimensionality increases the computational complexity of the algorithm and makes it more time-consuming.LightGBM is a distributed and efficient framework for implementing the GBDT algorithm.It uses the leaf-wise splitting method, histogram algorithm, and gradient-based one-side sampling method (GOSS) to modify GBDT.This effectively improves the data processing capability.What's more, limiting the depth of the tree can reduce the model complexity as well as the possibility to over fit.

Stacking
Stacking represents another form of ensemble learning.Unlike Random Forest and LightGBM, where the base learners are uniform, stacking combines diverse base learners using a meta-model, a method known as heterogeneous integration, as shown in Figure 2.
In this paper, Multilayer Perceptron, Random Forest, and LightGBM are selected as the base learner of the first layer, and linear regression is used as the meta-model of the second layer.The dataset is divided into a training set and a test set . is used to train the base learner of the first layer, which is randomly divided into subsets of the same size 1 , 2 , ..., .Using k-fold crossvalidation, prediction sets and models are obtained.The prediction values are integrated into a matrix, denoted as 1 .These models are predicted separately for .The predicted values are averaged to obtain the final result for the test set, denoted as 1 .In this paper, there are three machine learning models in the first layer.So, the output matrix of the training set is ( 1 , 2 , 3 ), denoted as , and the output matrix of the training set is ( 1 , 2 , 3 ), denoted as .A is used as the training set of the second-layer meta-model, while B is used as the test set of that.1).The length of the Labor Day holiday in 2019 is four days.The Mid-Autumn Festival and the National Day in 2017 are linked, with a total of 8 days off.However, public holidays exert influence on passenger flow not just during the holiday period itself but also on the days surrounding it.Considering that travelers often adjust their plans, possibly departing two days earlier or returning two days later [6], this study defines the holiday period from two days before the holiday to two days after.

Feature
Feature engineering is essential for machine learning.According to the prediction scenario in this paper, i.e., to forecast the flight passenger flow on holidays, which involves multiple holidays, air routes, and flights.And all these factors may be related to the fluctuation of passenger flow.Therefore, three major categories of features are considered in this paper: flight features, air routes features, and holiday features, which are described below.

Flight Features
In this study, flight features encompass the airline carrier, seat capacity, departure and arrival times, and the departure date (year and month).The choice of airline holds significant sway due to brand perception, with esteemed brands fostering trust and appeal among travelers, consequently drawing higher passenger volumes.Seat capacity delineates the maximum potential passenger flow for each flight, signifying the flight's capability.Furthermore, the specific take-off and landing times play a pivotal role; flights departing on the same day from identical routes might yield varying passenger flows owing to these temporal differences.Incorporating the year of the flight accommodates potential shifts in passenger volume corresponding to economic fluctuations across different years.Additionally, considering the seasonal dynamics impacting holiday travel, the month of the flight departure date captures these distinct seasonal preferences in passenger destination choices.

Air Routes Features
With the rapid development of high-speed rail, more passengers are opting for this mode of transportation, intensifying the competition between high-speed rail and civil aviation.In this case, the flight passenger flow will be affected to some extent.Hence, for air routes with high-speed rail access, this paper further characterizes the impact of high-speed rail competition.Ji-Peng Li [12] found that travel cost and travel time have a significant influence on the competition relationship between the two transportation modes.Therefore, this paper selects traveling time, the first-class and second-class fare, as well as the average daily frequency of high-speed rail to characterize the competition from it.The level of economic development affects the attractiveness of cities to travelers, resulting in differences in passenger flow during holidays.Therefore, this paper selects three features, namely city level, GDP per capita, and population, to describe the impacts of economic development.Among them, the city level reflects the comprehensive situation of cities in terms of political status, economic strength, city scale, and population size.GDP per capita reflects the affluence and economic development level of a city.Population can reflect the scale of passenger volume, which also directly determines the size of the volume base.

Holiday Features
This research delves into six distinct holidays, each with unique fluctuations, necessitating individual characterization.Distinct trends in fluctuations emerge between three-day and seven-day holidays, warranting separate treatment.Thus, it becomes imperative to discern whether a given holiday falls within the three-day or seven-day category.
Additionally, the impact of holidays on passenger flow varies across the holiday period, resulting in varying fluctuation patterns on different days within the holiday.As a result, it's crucial to identify the departure date's association with different phases of the holiday-specifically, constructing three additional features: "classification of the day before the holiday," "classification of the day during the holiday," and "classification of the day after the holiday."These features serve to capture the nuanced impact of holidays on passenger flow across different phases of the holiday period. Q: the days before the holiday.For example, Q1 represents the first day before the holiday, and Q2 represents the second day before the holiday. H: the days during the holiday.For example, H1 represents the first day of the holiday, and H2 represents the second day of the holiday. L: the days after the holiday.For example, L1 represents the first day after the holiday and L2 represents the second day after the holiday.

Evaluation Indicators
In order to evaluate and compare the accuracy of the forecast, Mean Absolute Percentage Error (MAPE) is selected as the metric in this paper.It is calculated as equation ( 2).
The sample size is .The true value is .The predicted value is .

Result and Discussion
To answer the questions listed at the end of the first section, the prediction results are compared and discussed from four aspects.

Separate Modeling vs. Unified Modeling
This study initially examines the efficacy of modeling each holiday individually versus a uniform model for all holidays.Analysis of prediction results indicates that the unified modeling approach yields lower prediction errors for each holiday compared to separate modeling.This suggests superior performance of the unified model.Notably, despite the uniformly modeled dataset encompassing a wider array of holidays, potentially involving more intricate prediction scenarios, the noticeable decrease in data volume significantly influences prediction accuracy (refer to Table 3).Consequently, this paper opts for a unified modeling strategy encompassing all holidays.

Feature Validity
Comparing the accuracy of prediction models with and without holiday features reveals their effectiveness, as demonstrated in Table 4.The prediction error observed with the inclusion of holiday features is notably 11.95% lower than that without, indicating the constructive impact of the holiday features constructed in this study on prediction accuracy.Consequently, given their positive influence, subsequent studies will continue to incorporate these holiday features.Initially, the study verifies whether the four models utilized can achieve this.Taking threeday holidays as an illustration, Table 5 illustrates that there's no substantial variance in prediction errors among the models for different days within the holiday duration.This suggests the models' capability to capture holiday fluctuation patterns effectively.
For instance, examining the real and predicted passenger flow curves of flight CA1557 from Beijing Capital Airport to Shanghai Hongqiao Airport during the Dragon Boat Festival in 2018 (Figure 3), it's evident that the prediction curves from different methods closely align with the actual curves.This further corroborates the models' proficiency in capturing the passenger flow trend during holidays.6.
LightGBM is the best prediction model in this scenario with the minimum error, while the prediction effect of Random Forest is relatively poor compared with other methods.Notably, LightGBM consistently demonstrates the lowest prediction error across various holiday durations, thus selected for subsequent analysis.Upon closer examination, the accuracy of predictions varies concerning holiday durations.Forecasts for eight-day holidays exhibit the highest accuracy, followed by seven-day holidays, while four-day holidays display the least accurate predictions.Interestingly, the Golden Week (comprising seven-day and eight-day holidays) generally yields more accurate predictions than three-day and four-day holidays.This discrepancy in prediction accuracy might stem from the composition of holidays.The Golden Week predominantly includes National Day, ensuring more consistent flow patterns compared to three-day holidays, which encompass a variety of holidays like New Year's Day, Qingming Festival, Labor Day, Dragon Boat Festival, and Mid-Autumn Festival.Such diverse holidays exhibit fluctuating passenger flow, challenging prediction accuracy.Moreover, three-day holidays show better prediction accuracy than four-day holidays, possibly due to a more significant data volume effect.However, both four-day and eight-day holidays entail specific observations, resulting in a smaller sample size, warranting further validation of study findings.

Conclusion
This paper has accomplished several works in applying machine learning methods to predict daily flight passenger flow during holidays: Various modeling approaches were explored, including separate modeling for distinct holidays and unified modeling for all holidays.The findings favor the latter approach, demonstrating superior prediction results.Additionally, this approach offers convenience for ongoing model maintenance and prediction of new data.Features were meticulously crafted to encapsulate holiday, air route, and flight information, serving as the foundation for predicting flight passenger flows during holidays.The results indicate that datasets incorporating holiday-related features outperform those without.Among the models examined in this study, LightGBM emerges as the top performer, showcasing the best performance in this prediction scenario.Further analysis delved into the variances in prediction performance of the best model across different holiday features, aiming to elucidate the underlying reasons.
While this study has made significant strides, certain limitations remain due to time and data constraints.The exploration was confined to only four machine learning models without fine-tuning their parameters or introducing additional model evaluation indicators.These areas pose promising directions for future research and improvement.

Acknowledgment
This paper is supported by The Scientific Research and Development Program of China State Railway Group Co., Ltd (N20222003).

Figure 1 .
Figure 1.Contrasting the regular air passenger flow on a specific route with the varied fluctuations observed during holiday periods

Figure 2 .
Figure 2. Heterogeneous integration model of Stacking3.Discription of the Experiment3.1.Research ObjectThis paper aims to predict the flight passenger flow during Chinese public holidays.There are seven public holidays in China: New Year's Day, Spring Festival, Qingming Festival, Labor Day, Dragon Boat Festival, Mid-Autumn Festival, and National Day. the Spring Festival is traditionally the most important holiday throughout the year, which leads to a large-scale population flow before and after the festival.For this reason, compared to other holidays, Spring Festival has a longer period of impact on traveling demands.Hence, it is significantly different from other holidays[2].For this reason, this paper selects the daily flight passenger flow of five three-day holidays, namely New Year's Day, Qingming Festival, Labor Day, Dragon Boat Festival, Mid-Autumn Festival, as well as the seven-day holiday, namely National Day, as the research object (Table1).The length of the Labor Day holiday in 2019 is four days.The Mid-Autumn Festival and the National Day in 2017 are linked, with a total of 8 days off.However, public holidays exert influence on passenger flow not just during the holiday period itself but also on the days surrounding it.Considering that travelers often adjust their plans, possibly departing two days earlier or returning two days later[6], this study defines the holiday period from two days before the holiday to two days after.

Figure 3 .
Figure 3. Actual vs. Forecasted Passenger Flow of CA1557 on PEKSHA at the 2018 Dragon Boat Festival This paper uses Random Forest, Multilayer Perceptron, LightGBM, and Stacking to construct a global model to train and predict all holidays together.The prediction errors are shown in Table6.LightGBM is the best prediction model in this scenario with the minimum error, while the prediction effect of Random Forest is relatively poor compared with other methods.

Figure 4 .
Figure 4. MAPE of each method for predicting different holiday durationsFor different holidays, the prediction results of LightGBM and Stacking are similar, and both perform well.The ranking of prediction errors for each method in forecasting passenger flow during holidays exhibits minimal variance.The prediction accuracy for the Mid-Autumn Festival appears to be the least satisfactory among these festivals.This might be because National Day is close to the Mid-Autumn Festival, which influences the passenger flow of the latter.Furthermore, the number of weeks between the Mid-Autumn Festival and National Day differs yearly.For instance, in 2017, both holidays coincided, while in 2018, one week separated them, and in 2019, there was a two-week gap.Consequently, this varying impact of National Day on the Mid-Autumn Festival contributes to irregular fluctuation patterns yearly, resulting in less accurate forecasts.Similarly, the Mid-Autumn Festival also influences the passenger flow of National Day, albeit to a lesser extent.Notably, National Day enjoys a larger dataset, being fixed on October 1 annually, while the date of the Mid-Autumn

Figure 5 .
Figure 5. MAPE of different holiday names predicted by each method

Table 1 .
The holidays included in this research The dataset used in this paper contains 54,175 records, covering 893 flights on 54 routes between 23 cities.The dataset includes daily flight sales during the holidays listed in Table1from 2017 to 2019, as well as basic flight information, such as route, take-off and landing time, number of seats, etc.The distribution and magnitude of flight sales are shown in Table2, with sales volumes ranging from 18 to 392 and a standard deviation of 62.

Table 2 .
Distribution of Sales volume per flight in the dataset

Table 3 .
Comparison between the results of separate modeling and unified modeling.

Table 4 .
MAPE obtained by LightGBM for predictions on datasets with and without holiday features.

Table 5 .
MAPE for each day of the three-day holidays

Table 6 .
MAPE of each method for prediction of passenger flow on holidays.The Effectiveness of Machine Learning Methods for Predicting Passenger Flow on Different HolidaysExamining the error distribution across different machine learning methods concerning various holiday features reveals intriguing insights.Figure4illustrates that the error rankings among different machine learning methods display negligible variations across different values of holiday duration.