Skip to content

chwankai/Flight-Ticket-Fares-Prediction-using-Machine-Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

✈️ Air Ticket Price Prediction (Machine Learning Project)

📌 Project Overview

This project focuses on predicting air ticket base fare prices using machine learning techniques. We analyze flight itinerary data and build regression models to estimate ticket prices based on flight features such as airports, airlines, travel duration, cabin type, and flight dates.

The goal is to compare multiple machine learning models and identify the best-performing model for price prediction.


👨‍🎓 Team Members

  • 242UT2449P SEE CHWAN KAI
  • 242UT24490 TEO JING AN
  • 242UT244B2 TEE KIAN HAO
  • 242UT2449Z KHO WEI CONG

📊 Dataset


⚙️ Technologies Used

  • Python
  • Pandas, NumPy
  • Matplotlib, Seaborn
  • Scikit-learn

Machine Learning Models:

  • Linear Regression
  • K-Nearest Neighbors (KNN)
  • Random Forest Regressor

🧹 Data Preprocessing

We performed data cleaning and feature engineering:

  • Removed missing values

  • Extracted flight date features:

    • flightMonth
    • flightDayOfWeek
  • Converted travel duration (ISO format → minutes)

  • Extracted fare class from fareBasisCode

  • Estimated number of stops

  • Encoded categorical variables using OneHotEncoder

  • Standardized numerical features using StandardScaler

  • Removed outliers (1st–99th percentile)


🧠 Machine Learning Models & Results

Linear Regression

  • R² Score: 0.6307
  • MAE: 63.84
  • RMSE: 88.88

K-Nearest Neighbors (Optimized)

  • R² Score: 0.8341
  • MAE: 20.11
  • RMSE: 59.57

Random Forest Regressor (Best Model) 👑

  • R² Score: 0.8722
  • MAE: 29.15
  • RMSE: 52.30

📊 Key Insights

  • Random Forest captures non-linear relationships best
  • Flight duration, airline, and cabin type strongly affect price
  • KNN performs well but is sensitive to tuning
  • Linear Regression underfits complex patterns

📈 Visualizations Included

  • Actual vs Predicted plots
Image Image Image
  • Feature importance (Random Forest)
Image

🚀 How to Run

1. Clone repo

git clone https://github.com/chwankai/Flight-Ticket-Fares-Prediction-using-Machine-Learning.git
cd air-ticket-price-prediction

2. Install dependencies

pip install pandas numpy matplotlib seaborn scikit-learn

3. Run notebook

Open:

Air_Ticket_Price_Prediction.ipynb

About

This project focuses on the domain of flight ticket price prediction, where the pricing is often influenced by factors such as flight duration, seat availability, airline, travel dates, and booking conditions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors