# Deep-Learning-Powered GRU Model for Flight Ticket Fare Forecasting
## 4 Experiments and Discussion  
The performance of the proposed GRU model was compared with that of the MLP and LSTM. During the training process, a number of parameters, such as batch size, activation function, number of hidden units, type of optimizer, and number of epochs, were adjusted until the best possible model was obtained. Four optimizers, including Adam, Adamax, RmsProp, and Sgd, were tested to minimize the loss. The losses with respect to the number of epochs for the four optimizers are compared in Figure 8. It can be observed from Figure 8 that the Adam optimizer converged much faster than the other three. Therefore, the Adam optimizer was adopted to train the models in the following experiments. Furthermore, the prediction performance was evaluated with three metrics, described as follows. Mean absolute error is the average of the absolute difference between the target value and the predicted output. \[MAE=\frac{1}{N}\ \sum_{i=1}^{N}\lvert y_{i}-\hat{y}_{i}\rvert \tag{12}\]  
Here, \(y_{i}\) denotes the actual value of the flight ticket fare, \(\hat{y}_{i}\) denotes the predicted value, and \(N\) denotes the number of samples. \(MAE\) is a commonly used metric since it provides an intuitive indicator of the extent to which the predicted values deviate from the actual values on average. \(MAE\) is easy to interpret, suitable for continuous variables, and less  
Figure 8: Convergence of loss for different optimizers. \begin{table}
\begin{tabular}{l l} \hline \hline
**Parameters** & **Value** \\ \hline Hidden Size & 824, 512, 256, 128, 64 \\ \hline Batch Size & 256 \\ \hline Number of Epochs & 800 \\ \hline Drop Out & 0.5 \\ \hline Learning Rate & 0.001 \\ \hline Out Size & 1 \\ \hline Optimizer & Adam \\ \hline Loss Function & Mean Absolute Error \\ \hline Layers & GRU \(\times\) 5 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Hyperparameter setting for the prediction model. sensitive to outliers, which means it is robust and can give a good overview of a model's performance [50]. Root mean square error (\(RMSE\)) is another metric widely used to evaluate prediction models. It is the objective function used for optimizing classic regression models. \(RMSE\) is computed as follows:  
\[RMSE=\sqrt{\frac{1}{N}\sum_{i=1}^{N}(y_{i}-\hat{y}_{i})^{2}}, \tag{13}\]  
where \(y_{i}\) represents the actual value of the flight ticket fare, \(\hat{y}_{i}\) represents the predicted value of the flight ticket fare, and \(N\) denotes the number of samples. \(RMSE\) is the standard deviation of predictions from a stochastic point of view. A small value of \(RMSE\) is indicative of a model with excellent performance. Additionally, the coefficient of determination, usually denoted as R\({}^{2}\), is a metric for evaluating how well a regression model performs in a number of analyses [51]. The computation of R\({}^{2}\) is formulated as follows:  
\[\text{R}^{2}=1-\frac{RSS}{TSS}=1-\frac{\sum_{i=1}^{N}(y_{i}-\hat{y}_{i})^{2}}{ \sum_{i=1}^{N}(y_{i}-\overline{y}_{i})^{2}} \tag{14}\]  
where \(\overline{y}_{i}\) is the mean of the total amount of data, \(y_{i}\) is the actual value of the flight ticket fare, and \(\hat{y}_{i}\) is the predicted flight ticket fare. \(RSS\) is the sum of squared prediction errors for the proposed model, \(TSS\) is the squared sum of the errors between the actual value and the mean of all outputs, and \(N\) is the number of samples. \(TSS\) denotes the error of the simple predictor, which simply takes the mean of all observations as the predicted output. A small ratio of \(RSS\) to \(TSS\), corresponding to a high R\({}^{2}\), means that the error of the prediction model is much smaller than that of that simple predictor, and the model is hence considered to be effective. The value of R\({}^{2}\) usually falls between 0 and 1; when R\({}^{2}\) is close to 1, this indicates that the model fits the data well in a number of analyses.