Skip to content

Latest commit

Β 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

✈️ Dynamic Pricing Simulator β€” Rule-Based Airline Revenue Analysis

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.


πŸ“Œ Business Overview & Problem

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.


πŸ› οΈ Key Features & Engineering Logic

  • πŸ—“οΈ Lead Time Calculation: the number of days between Booking_Date and Flight_Date.
  • πŸ”₯ Demand Score: a simple weighted combination of urgency (short lead time) and weekend travel:

$$\text{Demand Score} = \left( \frac{1}{\text{Lead Time Days} + 1} \times 50 \right) + (\text{Weekend} \times 20)$$

  • ⚑ 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
  • 🧹 Data Cleaning: removes records with invalid (negative) base prices and flight dates that precede the booking date.


πŸ“Š Visual Analytics

Dynamic Pricing Dashboard

πŸ’‘ Visual Insights

  1. 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.
  2. Lead Time Sensitivity: shorter lead times show more upward price scatter, reflecting the surge rule rather than an observed real-world booking pattern.
  3. 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.

🧰 Tech Stack & Tools

Category Tools & Libraries
Language Python 3.10+
Data Manipulation Pandas, NumPy
Data Visualization Seaborn, Matplotlib
Environment VS Code / Jupyter Notebooks
Version Control Git & GitHub

πŸ“ˆ Impact & Output

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.


πŸš€ How to Run Locally

Clone the repository:

git clone https://github.com/Mahmoud4265/Dynamic-Pricing-Revenue-Optimization-Engine.git

Navigate to the project directory:

cd Dynamic-Pricing-Revenue-Optimization-Engine

Install dependencies:

pip install pandas numpy matplotlib seaborn

Run the notebook: Open the .ipynb file and execute all cells.

About

πŸ“Œ Project Overview An advanced data engineering and analytics project simulating real-world algorithmic dynamic pricing strategies used by major airlines and high-demand platforms. The project focuses on synthesizing complex operational data, modeling real-time demand fluctuations, and dynamically updating ticket prices based on customer urgency.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages