1 of 35

DSN2099 Project Exhibition-II

​

Team : 20

​

2 of 35

Flight Fare Prediction Webapp

Guide:

​

Dr. Paras Jain

(Senior Assistant Professor)

Team Members:

​

​

Yash Sharma Mayank Samadhiya Shivam Bajpeyi Himanshu

(19MIM10068) (19MIM10077) (19MIM10082) (19MIM10085)

ML Model Front-end Back-end EDA

​

3 of 35

INTRODUCTION

Optimal timing for airline ticket purchasing from the consumer’s perspective is challenging principally because buyers have insufficient information for reasoning about future price movements. In this project we will make a webapp for computing expected future prices of several airlines.

4 of 35

EXITING WORK WITH LIMITATIONS

From the very beginning people try to book flights at cheaper cost so for doing that they follow some of these facts-

​

  • Generally, flights after 6 pm are cheaper

so people prefer to book flights at that time.

​

  • Airfares usually go up on Friday and start declining on

Monday or Tuesday whereas Wednesday and Thursday

are the cheapest days to book airline tickets.

​

  • According to a survey, to book ticket just 60 days before the flight is considered to be good because in such situation, we will get the ticket very cheap, the more they delay, the more expensive the ticket will be.

​

  • People also use some private companies website or app to buy the tickets for their journey but they don’t know, Is that price is cheaper or not?.

​

​

​

5 of 35

PROPOSED WORK AND METHODOLOGY

  • We are providing a platform to the travellers to compare the predicted fare of different airlines according the date, destination, and duration, etc. so that they can get cheaper flight tickets.

  • Do feature engineering and data preprocessing for the factors involved in Fare prediction.

​

  • Analyse the data and bring some meaningful insights using exploratory Data Analysis (EDA).

​

  • Build a user friendly ‘webapp’ that can predict airfare of various airlines to get flights at very low.

6 of 35

NOVELTY OF THE PROJECT

​

  • Transfer of information from various branches would become easier and faster.

​

  • Travellers can compare predicted airfare of various airlines on one platform So, It will be convenient for them.
  • Helpful for travellers to book cheapest flight.
  • Good accuracy, user friendly, and time saving.

7 of 35

REAL TIME USAGE

In the current scenario, many airlines change ticket prices for their revenue management. The airline may increase the prices when the demand is to be expected to increase the capacity and many people are unaware about it.

​

To estimate the minimum airfare , we have been collected the data for a specific air route including the features like departure time, arrival time and airways over a specific period.

​

Through this web app people can get minimum fare price for their journey and save more money.

8 of 35

HARDWARE REQUIRED

Minimum Laptop hardware requirements

  • Processor - i5
  • RAM - 4GB
  • SSD- 128MB (for faster execution)
  • HDD - 1 TB
  • Graphics Card - 2GB

​

9 of 35

SOFTWARE REQUIRED

  • Datasets (for Analysis and Visualization)
  • Jupyter notebook
  • Heroku (Cloud)
  • Flask(Web Framework)
  • Pycharm (IDE)

Programming Languages used:

➔ Python (3.9.0) for Machine Learning and making Webapp

➔ HTML (HTML5) for making frontend of webapp

​

Python Libraries used:

➔ numpy(1.16.5), matplotlib(3.1.1), sklearn(0.21.3), seaborn(0.9.0), pandas(0.25.1), etc.

*Libraries(version)

10 of 35

OVERALL SYSTEM ARCHITECTURE DIAGRAM

User Data

Model Prediction

Predicted Flight Fare

11 of 35

LITERATURE REVIEW

12 of 35

REFERENCES

  • Vu, V.H., Minh, Q.T., Phung, P.H., 2018. An airfare prediction model for developing markets. In: 2018 International Conference on Information Networking (ICOIN), Chiang Mai, 2018, pp. 765–770.

​

  • Chen, Y., Cao, J., Feng, S., Tan, Y., 2015. An ensemble learning based approach for building airfare forecast service. In: 2015 IEEE International Conference on Big Data (Big Data), Santa Clara, CA, 2015, pp. 964-969.

​

  • Liu, T., Cao, J., Tan, Y., Xiao, Q., 2017. ACER: An adaptive context-aware ensemble regression model for airfare price prediction. In: 2017 International Conference on Progress in Informatics and Computing (PIC), Nanjing, 2017, pp. 312–317.

​

  • K. Tziridis, T. Kalampokas, G.A. Papakostas, K.I. Diamantaras: Airfare prices prediction using machine learning techniques, 25th European Signal Processing Conference (EUSIPCO): Kos, 2017 (2017), pp. 1036-1039

​

13 of 35

[1] An airfare prediction model for developing markets

Addressed Problem- Ticket price prediction

Dataset- 51,000 records of a 7-day round trip nonstop flights of three domestic airlines

Features- Airline, flight number, date of purchase, departure date, departure time, arrival time, fare class, number of stops, price, departure airport, arrival airport, arrival date

Computational Techniques Used- A model called Stacked prediction model based on. Random Forest and Multilayer Perceptron model.

Performance Result- 4.4% and 7.7% better than Random Forest and Multilayer Perceptron respectively as measured by R2

Key Findings- They proposed a new model that can help the buyer to predict the price trends without official information from the airlines. There findings demonstrated that the proposed model can predict the trends as well as actual airfares changes up to the departure dates using public airfare data available online despite the missing of many key features like the number of unsold seats on flights. They also identified the features that have the strongest impacts on the airfare changes.

​

14 of 35

[2] An ensemble learning based approach for building airfare forecast service.

​

Addressed Problem- Minimum Ticket Price Prediction

Dataset- More than 3 months (110 days) data for 5 international routes.

Features- Prices of the same itinerary, prices of recent itineraries before the target day, prices of itineraries with the same day of week, price of itineraries with the same day of month.

Computational Techniques Used- An ensemble-based learning algorithm Learn++.NSE is modified and used.

Performance Result- Mean absolute percentage error (MAPE) of 10.7% as compared to KNN (12.58) and PA (15.41%).

Key Findings- In this paper, they address the problem of airfare forecast and present a systematic approach that covers the most important aspects of building a forecast service, including data modelling, forecast algorithm and long-term prediction strategies. A novel matrix-like data schema is first introduced to organize price series and extract temporal features. For the prediction task, we specifically investigate Learn++.NSE, an incremental ensemble classifier designed for learning in nonstationary environments. We further evaluate the forecast model on real-world price data collected from diverse routes and discuss its performance with respect to short-term and long-term prediction.

15 of 35

[3] ACER: An adaptive context-aware ensemble regression model for airfare price prediction

Addressed Problem- Predicting the lowest price available before departure date

Dataset- Data consisting of 19 different routes and spans three months period (92 days).

Features-Historical ticket prices, a signal indicating whether the departure date is holiday or not and number of days before departure.

Computational Techniques Used- Ensemble model that uses techniques such as K-Nearest Neighbors, Random Forest and Bayesian.

Performance Result- Improved the MAPE from (7% −12%) to (3.7% − 6%).as compared to the single model.

Key Findings- Inspired by the idea of bagging and boosting, context features are randomly selected to cluster data efficiently and multiple regression models are trained for data with different contexts. In the experiment on the real data set, model is compared with the baseline regression model, random forest and classical time series models.

​

16 of 35

[4] Airfare prices prediction using machine learning techniques

Addressed Problem- Comparing regression machine learning models for predicting airline ticket prices.

Dataset- A dataset consisting of 1814 flights for a single international route.

Features- Departure time, arrival time, number of free luggage, days before departure, number of intermediate stops, holiday, time of day and day of week.

Computational Techniques Used- Eight regression machine learning models had used that are linear regression, ridge regression, neural network regression, bagging regression, decision tree regression, random forest regression, SVM, KNN model.

Performance Result- Bagging Regression: 87.42% accuracy and Random Forest Regression Tree: 85.91% accuracy.

Key Findings- Along with the prediction accuracy of each model, this paper studies the dependency of the accuracy on the feature set used to represent an airfare. The derived experimental results reveal that the ML models are able to handle this regression problem with almost 88% accuracy, for a certain type of flight features.

​

​

​

​

17 of 35

MODULE DESCRIPTION

We have divided our whole project work into five modules that are-

​

  • Data Preprocessing- Here, we have found the description of dataset, check the null and remove the null values.
  • Exploratory Data Analysis (EDA)- In this module, we have made our dataset more simpler , standard, and handle the categorical data.
  • Feature Selection- To find out the important feature for our model that have good relation with target variable, we are using heatmap, feature importance, selectKbest methods.
  • Model Training and Evaluation- For training the model, we have split the dataset into train and test, then fit the model , and evaluated its performance.
  • Building WebApp- For webapp development, we are using flask framework and will make a user-friendly web app.

18 of 35

IMPLEMENTATION AND CODING

Key functions used:-

​

  • pandas.read_excel(‘path’)
  • train_data.isnull().sum()
  • train_data.dropna(inplace = True)
  • seaborn.catplot()
  • pandas.get_dummies()
  • seaborn.heatmap()
  • reg_rf.fit()
  • reg_rf.predict(X_test)
  • reg_rf.score(X_train, y_train)
  • reg_rf.score(X_test, y_test)
  • metrics.mean_squared_error(y_test, y_pred))
  • plt.scatter(y_test, prediction, alpha = 0.5)

​

​

19 of 35

MODULE WORKFLOW EXPLANATION

  1. Data Preprocessing- In this part we have basically checked the data, how the data is and other description related to data like max, min values, mean, etc. We have also checked whether dataset contains null values or not and then we have removed the null values.

​

  1. Exploratory Data Analysis (EDA)- The main purpose of EDA is to look at data before making any assumptions. In this part we have handled categorical data by one hot encoding and label encoding for nominal and ordinal data respectively as well as we have done data visualization to read the pattern of the data.

20 of 35

21 of 35

Figure 1: loading the data

SCREENSHOT & DEMO VIDEO

22 of 35

Figure 2: info() of data and removing null-values

​

23 of 35

Figure 3: EDA (Data Visualization and encoding)

24 of 35

Figure 4: Feature Selection(correlation)

​

25 of 35

Figure 5: Feature Selection(Feature Importance)

26 of 35

Figure 6: Model training and evaluation

27 of 35

28 of 35

29 of 35

TESTING

  • The training dataset contains total 10682 rows (records) and 30 features based on that we have performed k-fold cross validation to evaluate the model.

​

  • We have performed k-fold cross validation (k=5) to evaluate the model and accuracies we got were 0.82093, 0.82148, 0.83181, 0.80807, 0.79362 respectively and mean was 0.81519.

​

  • MSEs we got were pretty much low as the accuracies are quite good for our ML model.

​

30 of 35

RESULT AND DISCUSSION

  • Concluding the previous study, we can claim that “Bagging Regression Tree”, “Random Forest Regression Tree”, “Regression Tree” and MLP models are the most stable models according to their accuracy scores. In addition, as far as the execution time is concerned the best models are “Random Forest Regression Tree” and “Regression tree” and we have considered “Random Forest Regression Tree” for training our ML model.

​

  • The average performance accuracy of our model was: 81.51%

  • Different different errors:

MAE: 1155.30; MSE: 3806211.66; RMSE: 1950.95

​

  • Apart from the features selected, there are other features that could improve the prediction accuracy. In the future, this work could be extended to predict the airfare prices for the entire flight map of the airline. Additional experiments on larger airfare data sets are essential, but this initial pilot study highlights the potential of Machine Learning models to guide consumers to make an airfare purchase in the best market period

31 of 35

Figure 7: WebApp Interface (Input)

32 of 35

​

Figure 8: WebApp Interface (Output)

​

33 of 35

WEBAPP LINK

34 of 35

CONCLUSION

In this project to deal with the dynamic price changes in the flight tickets is presented, this gives the information about the highs and lows in the airfares according to the days, weekend and time of the day that is morning, evening and night also the machine learning models in the computational intelligence fields that are evaluated before on different datasets are studied. their accuracy and performances are evaluated and compared in order to get better results in this project. The accuracy of the Flight Fare Prediction Webapp model using random forest algorithm is 81.51% which is greater than the accuracy of other models that we have studied in the research papers. In the future, this work could be extended…………..

​

35 of 35

THANK YOU