This data science project was my first data science and machine learning project, based on a synthetic airline flight dataset found on Kaggle at www.kaggle.com/datasets/iamsouravbanerjee/airline-dataset. The end goal was to determine which flights and/or airports experienced the most delays, so that service and operations improvements could be concentrated there. This approach was of particular interest to me due to my experience analyzing customer feedback data during my time working in customer operations support.
Preprocessing of the dataset was performed using the following steps:
Removing null values and values containing "0" only and removing duplicate rows using the Pandas library in Python
Renaming of the Airport Name feature to Departure Airport
Adjusting the date/time format of the flight dates for consistency
Filtering flight data by deriving the top 10 dates and airports to facilitate data plotting
Feature Selection & Machine Learning Approach
Feature selection was performed using the SelectKBest and chi2 tools (for chi-square analysis) within the Scikit-learn library in Python with an 80/20 test-train split. Features with low value as indicated from the chi-square feature selection (such as passenger name) were removed from the dataset.
K-means clustering was used as a machine learning method to separate flights into 3 distinct status clusters:
Cluster 0: Cancelled flights
Cluster 1: On-time flights
Cluster 2: Delayed flights
Multiple histograms were calculated as part of the exploratory data process to compare flights by flight status, airport, and month using the Matplotlib library in Python. Please refer to the example below.
The visualisation below shows flight status in aggregate for the top 10 departure airports. This reveals that Santa Rosa Airport and Santa Maria Airport had the most delays, while Mae Hong Song had the most cancelled flights.
Research Question: Which periods of the year are associated with service fluctuations at specific airports among the top 10 departure airports?
Two separate heatmaps were created using the Seaborn package in Python to compare arriving and departing flight status clusters by month and airport. Please refer to the heatmap below for the comarison of airport performance for departing flights by flight status and month.
The analysis demonstrated that:
Santa Maria Airport had the highest amount of delayed flights for departing flights in March
High flight delays occurred in June at Santa Rosa, Cochrane, and San Fernando airports
Cancellations for departing flights were unusually high at:
San Fernando in May
Nogales International Airport in March
Santa Maria in April
This analysis indicates that operation procedures for Santa Maria and San Fernando airports should be reviewed for the months of March - June for departing flights to determine any factors causing delays and cancellations, such as weather conditions, staffing levels, or availability of aircraft to meet peak demand times.
Skills Demonstrated
Data preprocessing and cleaning
Feature selection and engineering
K-means clustering implementation
Temporal and categorical data visualization
Business analysis and recommendations
Python libraries: Pandas, Scikit-learn, Matplotlib, Seaborn
Advanced Data Science COMP11068
University of the West of Scotland
May 2023