Diego Malagrida Airline Passenger Satisfaction ↑ Top

Authors Diego Malagrida GonzálezAndreu Massanet Felix

Published14 Jan 2026

Sectionai

Length2 min

Airline Passenger Satisfaction

A 130,000-row passenger survey, cleaned with the reasons written down, segmented and then handed to five classifiers to argue over.

A radar chart with five axes — test accuracy, macro F1, macro precision, macro recall and the train-test gap (inverted) — and one line per classifier. Random Forest, SVM and the decision tree run close to the outer edge on every axis; logistic regression and the perceptron pull inward on all but the gap.
All five classifiers, plotted on the three things that actually matter here: accuracy, macro F1, and how little each one overfit.

Overview

A supervised-learning notebook over a 130k-row airline passenger survey: cleaning, PCA and K-means segmentation, then five classifiers tuned by grid search and compared on accuracy, macro F1 and the train-test gap.

The data is 103,904 training rows and 25,976 test rows, 24 columns wide. Some columns describe the passenger and the trip (age, customer type, class, distance, delays), and the rest are 1–5 ratings of individual services: wifi, boarding, seat comfort, entertainment, leg room, check-in, cleanliness. The label is binary: satisfied, or neutral and dissatisfied.

Two different questions are asked of it. Who are these passengers, which is unsupervised and gets PCA and K-means; and can satisfaction be predicted, which is supervised and gets the classifiers. Reporting the train-test gap alongside accuracy is deliberate: a model that wins on the training set and loses on the test set has not learned the survey, it has memorised it.

Random Forest and SVM come out on top, at 96.3% and 96.1% test accuracy, with the decision tree close behind at 95.6%. The two linear models fall well short of that: logistic regression at 87.1%, the perceptron at 83.2%. That gap is itself the finding — this problem rewards a model that can bend, not one that can only draw a line through it.

Project 3 of 3 for the Artificial Intelligence course at the Universitat de les Illes Balears, the one on supervised learning.

pythonmachine-learningdata-analysis

← All projects