Skip to content
Open to opportunities
SD
Project 08Data Science / Machine Learning2025

A supervised regression project predicting intra-European economy-class airfare in EUR, across ~200,000 rows and a full model comparison from linear regression through gradient boosting.

CompletedAcademic project — university coursework
European Flight Price Prediction screenshot
01

Overview

An academic data-science project predicting intra-European economy-class airfare (EUR) from a dataset of roughly 200,000 rows across 20 columns, comparing seven regression approaches from linear models through gradient boosting.

02

Problem

Airfare depends on a tangle of correlated factors — route, timing, distance, seasonality — and several of the most obviously predictive engineered features turn out to leak the target if you're not careful. The project needed both a solid model and honest handling of that leakage risk.

03

Approach

Extensive EDA and cleaning first: median/mode imputation for missing values, IQR-based outlier removal, and top-category grouping before one-hot encoding high-cardinality categorical fields. Feature engineering added `duration_hours`, `Is_Last_Minute`, `Is_Weekend` and `estimated_distance_km`. A `Price_per_km` feature was deliberately kept for exploratory analysis but excluded from the final model because it's derived from the target and would leak it.

04

Engineering

  • EDA and cleaning: missing-value imputation, IQR outlier removal, top-category grouping + one-hot encoding
  • Engineered features: duration_hours, Is_Last_Minute, Is_Weekend, estimated_distance_km
  • Model comparison: Linear Regression, Lasso, KNN, Weighted KNN, Decision Tree, Random Forest, Gradient Boosting
  • GridSearchCV with 5-fold cross-validation for hyperparameter tuning
  • Evaluation via MAE, MSE, RMSE and R², plus residual analysis and actual-vs-predicted visualization
  • Price_per_km retained for exploratory analysis only, excluded from the final model as target leakage
05

Result / Current State

Completed as a university project and received an excellent grade. The final model comparison, residual analysis and leakage-aware feature set are documented in the repository.

06

What I Learned

Recognizing that Price_per_km — one of the most obviously useful-looking engineered features — was actually derived from the target variable and had to be excluded from modeling despite its exploratory value. Getting outlier handling and categorical grouping right without discarding legitimate high-price long-haul-within-Europe routes was the other recurring judgment call.

Status
Completed

University project — excellent grade

Type
Academic project — university coursework
Category
Data Science / Machine Learning
Year
2025
Technology
Pythonpandasscikit-learnNumPymatplotlibseaborn
Links
07Screens

European Flight Price Prediction — screen 1 of 8
01 / 08
European Flight Price Prediction — screen 2 of 8
02 / 08
European Flight Price Prediction — screen 3 of 8
03 / 08
European Flight Price Prediction — screen 4 of 8
04 / 08
European Flight Price Prediction — screen 5 of 8
05 / 08
European Flight Price Prediction — screen 6 of 8
06 / 08
European Flight Price Prediction — screen 7 of 8
07 / 08
European Flight Price Prediction — screen 8 of 8
08 / 08