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.

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.
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.
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.
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
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.
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.
University project — excellent grade








