HANDS-ON-LAB

Flight Price Prediction Project with Polynomial Regression

Problem Statement

Predict the ticket price for flight using the Linear Regression Algorithm.

Dataset

The data contains 12 variables and of which Price is the Target variable. Complete data dictionary can be found here.

Kindly download the data from here.

Tasks

  1. Hypothesis based EDA:

    • Does the price vary with Airlines for the same source_city to destination_city?

    • How is the price affected when tickets are bought just 1 or 2 days before departure?

    • Does ticket price change based on the departure time and arrival time?

  1. Check the distribution of Price variable and remove outliers to create a new dataset

  2. Build a Linear regression Model with all the features (m1) and then select only top 5 features using the model coefficient and rebuild the regression model (m2) again using Statsmodels. Observe if there are any differences between the two models in Adjusted-R2 and R2. 

  3. Build a Linear Regression model using Scikit learn and Statsmodels; compare the results

  4. Apply Polynomial Features to the data to create polynomial features (choose degree = 2 and 3 to compare how it is performing)

  5. Now run the steps 3 & 4 again and compare the results of normal regression and polynomial regression models.


Explore the impact of airlines, booking time, and departure/arrival time on ticket prices.

FAQs

Q1. Does the price vary with Airlines for the same source_city to destination_city?

Yes, the price can vary based on the airlines for the same source and destination cities.

 

Q2. How is the price affected when tickets are bought just 1 or 2 days before departure?

Generally, ticket prices tend to increase when bought closer to the departure date due to higher demand.

 

Q3. Does ticket price change based on the departure time and arrival time?

Yes, ticket prices can vary based on the departure time and arrival time, as different time slots may have different demand levels.