Flight Price Predictor
A Random Forest regression model predicting flight prices at an R² of 0.87 — built to support dynamic pricing decisions with real feature engineering behind it.
Model Performance
How well the model actually explains price variation — the honest numbers, not just the headline R².
Case File
Three angles on the same build — click through.
Flight prices swing constantly based on demand, seasonality, and how far out you book — but that pricing logic is opaque from the outside. Airlines optimize it internally; nobody outside gets a clear model of what's actually driving the number on any given route.
The goal was to reverse-engineer enough of that signal to predict price accurately from a small set of interpretable features — proving that dynamic pricing isn't a black box, it's a regression problem with the right feature engineering.
- Feature Engineering — converted raw booking data into signals that actually predict price: days-before-departure, route distance, time-of-day bucket, and seasonal demand flags, instead of feeding the model raw dates.
- Preprocessing — handled categorical encoding for airlines and routes, and normalized numerical features so the model wasn't skewed by scale differences between price and distance.
- Model Choice — went with Random Forest over a single decision tree specifically because it handles the non-linear relationship between days-before-departure and price (that late-booking price spike isn't linear) without overfitting to noise.
- Evaluation — measured with R² rather than raw error alone, since the goal was explaining price variance across very different route types, not just minimizing error on the most common ones.
A model explaining 87% of the variance in flight prices from a compact, interpretable feature set — accurate enough to support real dynamic-pricing decisions, not just a classroom exercise.
The bigger takeaway: most of the performance gain came from feature engineering, not model complexity. A well-chosen feature set with Random Forest beat more complex approaches with poorly engineered inputs — a pattern that's shown up in every ML project since.
Try the Price Estimator
Adjust the inputs to see how the same signals used in training shift a predicted fare.
Stack
Click any tag to see how it's actually used in this project.
Click any technology above to see exactly how it's used in this build.