Project Overview
Customer satisfaction plays a crucial role in the airline industry's success, influencing passenger loyalty, brand reputation, customer retention, and long-term business growth. Understanding what makes passengers satisfied or dissatisfied can help airlines improve their services and make better business decisions.
This project, titled Training Machine Learning Model to Predict Airline Customer Satisfaction, explores how machine learning can be used to analyse passenger survey data, identify patterns in customer experiences, and predict satisfaction levels.
The project was completed as an individual academic research project at the University of East London as part of the CN7000 module.
Using Python and machine learning techniques, the research investigates various factors influencing airline passenger satisfaction, including service quality, in-flight entertainment, cleanliness, travel class, flight distance, passenger demographics, and customer loyalty.
The primary objective was to develop and compare multiple classification algorithms to identify an effective predictive model for airline customer satisfaction.
Project Objectives
The main objectives of this project were:
- Investigate how machine learning can improve customer experience management in the airline industry.
- Analyse airline passenger survey data to identify patterns and relationships.
- Perform data cleaning and preprocessing to prepare the dataset for machine learning.
- Conduct exploratory data analysis (EDA) to understand factors influencing passenger satisfaction.
- Develop multiple classification models to predict customer satisfaction.
- Compare machine learning algorithms using appropriate evaluation metrics.
- Optimise model performance through hyperparameter tuning.
- Identify practical insights that airlines can use to improve passenger experiences.
Dataset and Data Collection
The project uses the Airline Passenger Satisfaction Survey dataset, sourced from Kaggle.
The dataset contains passenger survey information covering different aspects of airline services, customer demographics, travel characteristics, and satisfaction ratings.
The dataset was downloaded in CSV format and stored locally for analysis and model development.
Important variables explored during the project include:
- Age and gender.
- Customer type and travel purpose.
- Travel class.
- Flight distance.
- Departure and arrival delays.
- In-flight Wi-Fi service.
- Food and drink services.
- Online boarding.
- Seat comfort.
- In-flight entertainment.
- Cleanliness.
- Overall passenger satisfaction.
These variables provide a foundation for understanding the relationship between airline service quality and customer satisfaction.
Data Preprocessing and Preparation
Data preprocessing was an important stage of the machine learning workflow. The objective was to prepare the raw dataset for exploratory analysis and predictive modelling.
1. Data Cleaning
The initial dataset was inspected to identify unnecessary variables and improve its structure.
The SR and id columns were removed because they represented record identifiers rather than meaningful predictive information.
Removing these columns helped simplify the dataset and focus the analysis on relevant passenger and service-related variables.
2. Categorical Data Encoding
Machine learning algorithms generally require numerical input variables. Therefore, categorical features were converted into numerical representations.
Two encoding techniques were applied:
Label Encoding: Used for categorical variables such as Gender and Customer_Type.
One-Hot Encoding: Used to transform other categorical variables into numerical indicator columns.
3. Feature Standardisation
StandardScaler from Scikit-learn was applied to selected numerical variables:
- Age
- Flight_Distance
- Departure_Delay_in_Minutes
- Arrival_Delay_in_Minutes
Standardisation helped bring numerical features onto a comparable scale, particularly for algorithms sensitive to feature magnitude.
4. Train-Test Split
The dataset was divided into two subsets using Scikit-learn's train_test_split function.
- Training dataset: 80%
- Testing dataset: 20%
This approach allowed the models to be trained on one portion of the dataset and evaluated on previously unseen observations.
Exploratory Data Analysis (EDA)
Exploratory Data Analysis was performed to understand the dataset and investigate relationships between passenger characteristics, airline service quality, and satisfaction levels.
Statistical analysis and visualisations were used to examine patterns across different variables.
Key Areas of Analysis
1. Satisfaction Across Travel Classes
Passenger satisfaction was compared across different travel classes to investigate how the overall travel experience varied between service categories.
2. Impact of Flight Distance
The relationship between flight distance and satisfaction was explored to understand whether passenger experiences differed across shorter and longer journeys.
3. Age and Gender Analysis
Passenger demographics were analysed to identify differences in satisfaction patterns across age groups and genders.
4. Travel Purpose
Personal and business travellers were compared to explore differences in their satisfaction distributions.
5. Service Quality and Cleanliness
The analysis investigated how cleanliness ratings and other in-flight service attributes were associated with passenger satisfaction.
6. Customer Loyalty
Satisfaction levels were compared between loyal and disloyal customer groups to explore the relationship between customer loyalty and the overall travel experience.
The EDA stage provided a clearer understanding of the factors associated with airline passenger satisfaction and helped establish the context for predictive modelling.
Machine Learning Model Development
The central part of this project involved developing and comparing supervised machine learning classification algorithms.
Four primary classification algorithms and an optimised Random Forest model were evaluated.
1. Logistic Regression
Logistic Regression was implemented as a baseline classification model to predict whether passengers were satisfied or neutral/dissatisfied.
It provided an interpretable starting point for understanding the predictive relationship between passenger attributes and satisfaction.
Reported accuracy: 87.30%
2. Decision Tree Classifier
The Decision Tree algorithm was used to capture non-linear relationships between input variables and passenger satisfaction.
Its tree-based structure also provides an understandable representation of how different features contribute to classification decisions.
Reported accuracy: 94.44%
3. Random Forest Classifier
Random Forest is an ensemble learning algorithm that combines predictions from multiple decision trees.
It was introduced to improve predictive performance and reduce the limitations associated with relying on a single decision tree.
The model achieved a significant improvement over Logistic Regression and Decision Tree.
Reported accuracy: 96.24%
4. Support Vector Machine (SVM)
Support Vector Machine was implemented to classify passenger satisfaction using decision boundaries that separate different classes.
The model provided another benchmark for comparing the performance of different classification approaches.
Reported accuracy: 94.31%
5. Hyperparameter-Tuned Random Forest
After evaluating the initial models, Random Forest was selected for further optimisation.
GridSearchCV was used to explore combinations of hyperparameters and identify a configuration that improved predictive performance.
Parameters considered included:
n_estimatorsmax_depthmin_samples_split
The tuned model was subsequently evaluated using the testing dataset.
Reported accuracy: 96.26%
Model Performance Comparison
The experimental results demonstrated that ensemble learning techniques performed particularly well for this classification task.
| Machine Learning Model | Accuracy |
|---|---|
| Logistic Regression | 87.30% |
| Decision Tree | 94.44% |
| Random Forest | 96.24% |
| Support Vector Machine | 94.31% |
| Tuned Random Forest | 96.26% |
The hyperparameter-tuned Random Forest model achieved the highest reported accuracy of 96.26%.
Compared with the original Random Forest model, the improvement was relatively small but demonstrated the potential benefit of systematic hyperparameter optimisation.
Model Evaluation
The models were evaluated using confusion matrices and classification accuracy.
Confusion matrices helped examine:
- True Positives: Satisfied passengers correctly classified as satisfied.
- True Negatives: Neutral/dissatisfied passengers correctly classified.
- False Positives: Neutral/dissatisfied passengers incorrectly classified as satisfied.
- False Negatives: Satisfied passengers incorrectly classified as neutral/dissatisfied.
This evaluation provided additional information about the types of classification errors made by each model.
The comparison demonstrated that Random Forest-based approaches offered a strong balance between correctly identifying satisfied and neutral/dissatisfied passengers.
Key Findings and Business Insights
The project highlights the potential of machine learning in supporting customer experience management within the airline industry.
Some important findings and implications include:
1. Predictive Analytics Can Support Better Decisions
Machine learning can help airlines analyse passenger feedback and identify patterns associated with satisfaction.
2. Service Quality Matters
Factors such as cleanliness, in-flight entertainment, and other service attributes are important dimensions to investigate when evaluating customer experience.
3. Customer Segmentation Provides Valuable Insights
Analysing satisfaction across travel classes, customer types, age groups, and travel purposes can help airlines better understand different passenger segments.
4. Ensemble Learning Delivered Better Predictive Performance
Random Forest and its tuned version achieved the strongest results among the evaluated models.
5. Customer Satisfaction Can Inform Service Improvements
Predictive insights can help airlines identify areas that may require attention and prioritise improvements to their passenger experience.
Challenges and Limitations
During the research, several important considerations were identified:
- Preparing categorical and numerical variables for machine learning.
- Selecting relevant features while removing unnecessary information.
- Comparing different classification algorithms.
- Understanding classification errors beyond overall accuracy.
- Optimising model hyperparameters.
- Considering data privacy and potential algorithmic bias.
Another important limitation is that predictive accuracy alone does not establish whether a model will deliver measurable improvements in real-world airline operations.
Further validation using additional datasets and real operational environments would be necessary before production deployment.
Future Improvements
Several enhancements could extend the capabilities of this research:
1. Advanced Machine Learning Algorithms
Experiment with additional ensemble techniques, including Gradient Boosting, XGBoost, and LightGBM.
2. Deep Learning Approaches
Investigate neural networks and other deep learning techniques for more complex passenger behaviour analysis.
3. Feature Engineering
Develop more advanced features to capture relationships between passenger demographics, service quality, and travel characteristics.
4. Sentiment Analysis
Incorporate airline reviews and social media feedback to identify customer sentiment and emerging service issues.
5. Real-Time Prediction
Explore deploying trained models into production environments to generate predictions using continuously updated passenger data.
6. Model Monitoring
Implement monitoring processes to identify changes in data distributions and predictive performance over time.
Conclusion
The Airline Customer Satisfaction Prediction project demonstrates how machine learning can be applied to a real-world business problem within the aviation industry.
Through data collection, preprocessing, exploratory data analysis, classification modelling, and performance evaluation, the research explored different approaches to predicting passenger satisfaction.
Five model configurations were compared, with the hyperparameter-tuned Random Forest achieving the highest reported accuracy of 96.26%.
The findings highlight the potential of predictive analytics to help airlines better understand passenger experiences, identify service-related patterns, and make more informed decisions.
This project strengthened my practical understanding of Python-based machine learning, data preprocessing, exploratory data analysis, classification algorithms, model evaluation, and hyperparameter optimisation.
It also demonstrated how data science techniques can translate customer survey data into insights that support business decision-making.
Project Information
Project Title: Training Machine Learning Model to Predict Airline Customer Satisfaction
Institution: University of East London
Module: CN7000
Project Type: Individual Academic Research Project
Primary Technology: Python and Scikit-learn
Best Performing Model: Hyperparameter-Tuned Random Forest
Reported Accuracy: 96.26%