A rule-based simulation that models how a simple demand-scoring system could adjust airline ticket prices, and estimates the resulting revenue impact on a synthetic dataset.
Traditional fixed-pricing models can leave revenue on the table during high-demand periods and unsold seats during off-peak ones. This project explores one possible response to that: a rule-based pricing engine that scores each booking's "demand" from two signals β how close the booking is to departure, and whether the flight falls on a weekend β and adjusts the price accordingly.
Note on the data: the dataset used here is fully synthetic, generated with NumPy to resemble airline booking records (routes, airlines, lead times, cancellations). It is not real airline data, and the cancellation outcomes are assigned independently of price β so this project demonstrates the mechanics of a dynamic-pricing pipeline (data generation β cleaning β feature engineering β EDA β impact estimate), not a validated real-world pricing strategy.
- ποΈ Lead Time Calculation: the number of days between
Booking_DateandFlight_Date. - π₯ Demand Score: a simple weighted combination of urgency (short lead time) and weekend travel:
-
β‘ Surge Multipliers (fixed thresholds):
-
High Demand (
$\text{Score} \ge 15$ ):$+30%$ -
Standard Demand (
$5 \le \text{Score} < 15$ ):$+10%$ -
Early Bird / Low Demand (
$\text{Score} < 5$ ):$-10%$ discount
-
High Demand (
-
π§Ή Data Cleaning: removes records with invalid (negative) base prices and flight dates that precede the booking date.
- Price Distribution: premium carriers (Emirates, Qatar Airways) have higher base pricing than budget carriers (Wizz Air, FlyNas), as set in the simulation's base-price assumptions.
- Lead Time Sensitivity: shorter lead times show more upward price scatter, reflecting the surge rule rather than an observed real-world booking pattern.
- Cancellations by Class: cancellation rate is generated independently of price in this simulation, so this chart describes the synthetic sample composition rather than a price-cancellation relationship.
| Category | Tools & Libraries |
|---|---|
| Language | Python 3.10+ |
| Data Manipulation | Pandas, NumPy |
| Data Visualization | Seaborn, Matplotlib |
| Environment | VS Code / Jupyter Notebooks |
| Version Control | Git & GitHub |
Measured on the (non-cancelled) simulated bookings:
==================================================
π° Total Revenue (Standard Pricing) : $355,227.71
π Total Revenue (Dynamic Pricing) : $371,219.36
π Total Revenue Lift : +4.50%
==================================================
Important limitation: this figure assumes the same number of bookings occur regardless of price β the simulation does not model how demand or cancellations would actually respond to a price increase (price elasticity). In reality, raising price during "high demand" periods could also raise cancellation or no-booking rates, which this lift estimate does not account for. Treat this number as an upper-bound illustration of the rule's mechanics, not a validated revenue forecast.
Clone the repository:
git clone https://github.com/Mahmoud4265/Dynamic-Pricing-Revenue-Optimization-Engine.gitNavigate to the project directory:
cd Dynamic-Pricing-Revenue-Optimization-EngineInstall dependencies:
pip install pandas numpy matplotlib seabornRun the notebook:
Open the .ipynb file and execute all cells.
