Skip to content

Supervised Machine Learning project to predict airline passenger satisfaction using Python and sklearn. Includes model training, evaluation, and deployment using Gradio for interactive prediction. Visualizations created with Matplotlib and Seaborn to support data-driven insights.

Notifications You must be signed in to change notification settings

Anna-Ann11/passenger-satisfaction-prediction

Repository files navigation

✈️ Airline Passenger Satisfaction Prediction

This machine learning project predicts whether an airline passenger is Satisfied or Not Satisfied based on in-flight experience and service metrics. It includes an interactive Gradio app where users can enter details and get real-time satisfaction predictions.


🧠 Objective

To apply multiple supervised learning algorithms and build a reliable model that can predict customer satisfaction using airline service data.


📂 Project Structure

  • Data Preprocessing:

    • Dropped irrelevant columns (id, Unnamed: 0)
    • Encoded categorical variables using LabelEncoder
    • Scaled numerical features using StandardScaler
  • Model Training:

    • Tested multiple classifiers:
      LogisticRegression, DecisionTreeClassifier, RandomForestClassifier,
      GradientBoostingClassifier, KNeighborsClassifier, SVC
    • Selected the best-performing model based on accuracy score
  • Deployment:

    • Built a Gradio interface to accept user input and return prediction
    • Used pickle to save/load the trained model

📊 Features Used

  • Demographics: Gender, Age, Customer Type
  • Flight Experience: Class, Type of Travel, Flight Distance
  • Services Rated:
    • Inflight Wifi, Food and Drink, Online Boarding, Seat Comfort,
      Entertainment, Cleanliness, Check-in Service, Leg Room Service, etc.
  • Time Delays: Departure Delay, Arrival Delay

🔍 Visualizations

  • Pie chart for satisfaction distribution
  • Bar plots for average flight distance by class
  • Heatmap of model confusion matrix for classification evaluation

📸 Screenshots

  • 📊 Satisfaction Distribution Pie Chart
    Pie Chart

  • 📉 Average Flight Distance by Travel Class
    Bar Plot

  • 🧾 Confusion Matrix from Model Evaluation
    Confusion Matrix

  • 🎛️ Gradio Interface
    Gradio UI Gradio UI

  • 📈 Sample Prediction Output
    Prediction Result Prediction Result


🧪 ML Models Used

  • Logistic Regression
  • Decision Tree
  • Random Forest
  • K-Nearest Neighbors
  • Gradient Boosting
  • Support Vector Machine

✅ Final model chosen based on accuracy and generalization performance


🚀 How to Run the Project

  • Clone the repo:
    git clone https://github.com/Anna-Ann11/passenger-satisfaction-prediction.git
    cd passenger-satisfaction-prediction
    

Install the required libraries:

pip install -r requirements.txt

Run the notebook:

jupyter notebook passenger_model.ipynb

Or launch the Gradio app:

iface.launch()

About

Supervised Machine Learning project to predict airline passenger satisfaction using Python and sklearn. Includes model training, evaluation, and deployment using Gradio for interactive prediction. Visualizations created with Matplotlib and Seaborn to support data-driven insights.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published