# Deep-Learning-Powered GRU Model for Flight Ticket Fare Forecasting
## 3 Methodology
### Preliminary Data Analysis  
Data visualization is essential for interpreting complex datasets, allowing users to make sense of a large amount of information quickly and efficiently [37; 38]. The data ranged from January 2018 to July 2022, and there were more than 1,000,000 records from 22 domestic and international airline destinations. As we dove into analyzing this vast dataset, it became crucial to present the findings in an easily interpretable way so as to bring about the insights intuitively. We employed data visualization techniques to reveal patterns, trends, and correlations that would otherwise have been challenging to discern. Figure 1 shows the relationship between travel dates and flight ticket fares (in USD), with six subfigures depicting different aspects of the data. Figure 1a-e display the monthly averages of flight ticket fares for the year 2018 through the year 2022 (up to July), which reveal information regarding price changes over time. Figure 1f further presents a more granular view of the data that depicts the daily fares of flight tickets for the entire dataset. Collectively, these subfigures give an overview of trends and fluctuations concerning prices for the whole dataset.  
Additionally, Figure 2 presents a boxenplot of flight fares versus booking classes. The boxenplot is a commonly used statistical tool that displays the distribution of a dataset and highlights such key features as the median, quartiles, and outliers. Unlike a traditional boxplot, the boxenplot divides the data into smaller subgroups, allowing for a more detailed view of the distribution. In this case, we used the boxenplot to examine the relationship between the flight fare and the booking class, which is the letter code used by the airline to identify the fare type and restrictions of a ticket. By analyzing the boxenplot, we were able to identify the ranges of ticket fares as well as the potential outliers or anomalies that might have an impact on our analysis. This initial exploration served as a foundation for our subsequent pilot analysis, allowing us to better understand the data beforehand. Furthermore, the correlations between the features were computed, and a few of them are selected and displayed in Table 3. As can be observed from Table 3, some features, such as Holiday, Week Day, Seg_Dest, and Class of Service, are highly correlated to the Actual Fare. The preliminary data analysis, consisting of descriptive statistics and correlation techniques, has provided valuable insights into the key factors that impact flight ticket prices. These insights were instrumental in the development of an accurate prediction model.  
\begin{table}
\begin{tabular}{l l l l l} \hline \hline \multirow{2}{*}{**No.**} & \multirow{2}{*}{**Origin**} & \multirow{2}{*}{**Destination**} & \multicolumn{2}{c}{**Flight Type**} \\ \cline{3-5}  & & & **Domestic** & **International** \\ \hline
1. & Addis Ababa (ADD) & ASO (Asoa) & Yes & No \\ \hline
2. & Djibouti (JIB) Djibouti & Addis Ababa (ADD) & No & Yes \\
3. & Addis Ababa (ADD) & Entebbe (EBB) Uganda & No & Yes \\
4. & Hargeisa (HGA) Somalia & Addis Ababa (ADD) & No & Yes \\
5. & Addis Ababa (ADD) & Hawassa (AWA) & Yes & No \\
6. & Bahir Dar (BJR) & Addis Ababa (ADD) & Yes & No \\ \hline
7. & Dire Dawa (DIR) & Addis Ababa (ADD) & Yes & No \\ \hline \hline \end{tabular}
\end{table}
Table 2: A few samples of the flight data.  
Figure 1: Flight ticket fares versus time periods. (**a–e**) monthly averages for year 2018 through year 2022 (up to July) and (**f**) daily fares of flight tickets for the whole dataset.  
Figure 2: Boxenplot of flight ticket fares versus booking classes.