How kanguyen2802/hotel-booking-demand works
1. Purpose and entry points
This is an analytics and decision-support repository for hotel booking demand, focused on improving proxy RevPAR while controlling cancellations, overbooking/walk risk, and channel conflict across City and Resort properties. It produces a recommend-only pricing and booking-risk playbook, not an operational booking engine.
Primary entry points:
• Project workflow and decisions: README.md
• Static executive dashboard: dashboard-html/index.html
• Power BI report project: dashboard-powerbi/Power BI/Hotel Booking Demand v2.pbip
• Reproducible analytical workflow: notebooks/01_data_cleaning.ipynb
• Final playbook and implementation material: reports/28_finalize_dynamic_pricing_playbook.md, reports/34_implementation_guide.md
2. Data foundation and serving boundary
The curated analytical source is data/hotel_bookings_v5.csv; it represents cleaned booking-level data and feeds notebooks, SQL import, and star-schema construction. Raw Kaggle data is intentionally external/local-only for full reproduction.
A Python transformation builds dashboard-oriented dimensional and fact CSVs:
• scripts/build_star_schema_v5.py
• data/star schema/hotel_bookings_normalized.csv
• data/star schema/revpar_monthly.csv
The key semantic boundary is that occupancy and RevPAR are proxies derived from booking/cancellation records; there is no true room-inventory or accounting P&L source.
3. Analytical and modeling pipeline
The notebook sequence is the main research/control flow: cleaning → EDA/statistical testing → cancellation prediction → demand/ADR/RevPAR forecasting → elasticity and pricing optimization → simulation/back-testing.
Representative stages:
• Data cleaning and derived KPIs: notebooks/01_data_cleaning.ipynb
• Cancellation and ADR EDA: notebooks/02_eda_stage1_cancellation.ipynb, notebooks/03_eda_stage2_adr.ipynb
• Demand and revenue forecasting: notebooks/18_demand_forecasting_dynamic_pricing.ipynb
• City/Resort price elasticity and optimization: notebooks/22_dynamic_pricing_elasticity_city_resort.ipynb, notebooks/23_dynamic_pricing_optimization_city_resort.ipynb
• Scenario validation: notebooks/27_validate_simulation.ipynb
The architecture deliberately separates City and Resort analysis; a shared policy or pooled model is treated as a decision risk.
4. Cancellation-risk decision layer
Cancellation prediction supports booking tiers and controlled buffer policies rather than autonomous customer actions. The model evolution is retained in notebooks and portable parameter/policy artifacts:
• models/Cancellation Predict Model v2/09_cancellation_model_v2_2.ipynb
• models/Cancellation Predict Model v2/artifacts/threshold_policy_v2_2.json
• models/Cancellation Predict Model v2/artifacts/fp_reduction_policy_v2_1.json
The intended flow is booking attributes → calibrated cancellation probability → Low/Medium/High risk tier → friction, CRM confirmation, or constrained refill/buffer recommendation. Leakage-prone post-booking fields are excluded from the modeling approach.
5. SQL and BI semantic layer
SQL Server provides a separately executable star-schema path: import the curated CSV, create schema, populate facts/dimensions, then run business questions.
• sql/01_create_star_schema.sql
• sql/02_populate_star_schema.sql
• sql/03_business_questions.sql
Power BI is a versioned PBIP/TMDL implementation of the same decision views. Its semantic model defines facts, dimensions, relationships, and measures:
• dashboard-powerbi/Power BI/Hotel Booking Demand v2.SemanticModel/definition/model.tmdl
• dashboard-powerbi/Power BI/Hotel Booking Demand v2.SemanticModel/definition/relationships.tmdl
• dashboard-powerbi/Power BI/Hotel Booking Demand v2.SemanticModel/definition/tables/Fact_Booking.tmdl
This is a file-based BI project requiring Power BI Desktop and local CSV path refresh; it is not backed by a deployed API.
6. Presentation and deployment surfaces
The HTML dashboard is a static vanilla-JS/Chart.js application. index.html establishes the page shell; application state/rendering, charts, and range interaction are separated:
• dashboard-html/js/app.js
• dashboard-html/js/charts.js
• dashboard-html/js/rangeBrush.js
dashboard-html/_export_data.py refreshes dashboard data from the star-schema CSV layer. Vercel deployment is configured in dashboard-html/vercel.json.
A separate static SCQA narrative report is deployed similarly:
• reports/html/index.html
• reports/html/scqa_data_storytelling.html
• reports/html/vercel.json
External infrastructure is limited to Vercel static hosting, SQL Server for optional T-SQL execution, Power BI Desktop for the PBIP report, and the original Kaggle dataset for raw-data reproduction.
Main entry points: hotel_bookings_normalized.csv Normalized bookings · 28_finalize_dynamic_pricing_playbook.md Dynamic pricing playbook · hotel_bookings_v5.csv Curated booking data · build_star_schema_v5.py Star-schema builder
Components 22
Data foundation
- Curated booking data · Cleaned booking-level analytical source; occupancy and RevPAR remain proxies.
data/hotel_bookings_v5.csv - Star-schema builder
scripts/build_star_schema_v5.py - Normalized bookings
data/star schema/hotel_bookings_normalized.csv - Monthly proxy RevPAR
data/star schema/revpar_monthly.csv
Analytical workflow
- Cleaning and KPI derivation
notebooks/01_data_cleaning.ipynb - Cancellation and ADR EDA
notebooks/02_eda_stage1_cancellation.ipynb - Demand and revenue forecasting
notebooks/18_demand_forecasting_dynamic_pricing.ipynb - City/Resort elasticity · Property types are modeled separately to avoid pooled-policy risk.
notebooks/22_dynamic_pricing_elasticity_city_resort.ipynb - Pricing optimization
notebooks/23_dynamic_pricing_optimization_city_resort.ipynb - Scenario validation
notebooks/27_validate_simulation.ipynb
Cancellation-risk policy
- Cancellation model · Uses booking attributes while excluding leakage-prone post-booking fields.
models/Cancellation Predict Model v2/09_cancellation_model_v2_2.ipynb - Risk-tier threshold policy · Maps cancellation probability to Low, Medium, and High tiers.
models/Cancellation Predict Model v2/artifacts/threshold_policy_v2_2.json - False-positive reduction policy
models/Cancellation Predict Model v2/artifacts/fp_reduction_policy_v2_1.json - Dynamic pricing playbook · Recommend-only guidance for pricing, buffers, and booking risk.
reports/28_finalize_dynamic_pricing_playbook.md - Implementation guide
reports/34_implementation_guide.md
BI and presentation
- SQL Server star schema · Separately executable import and fact/dimension population path.
sql/02_populate_star_schema.sql - SQL business questions
sql/03_business_questions.sql - Power BI semantic model · Local CSV-refresh semantic layer with facts, dimensions, relationships, and measures.
dashboard-powerbi/Power BI/Hotel Booking Demand v2.SemanticModel/definition/model.tmdl - Power BI report · Opened locally in Power BI Desktop; not served by an API.
dashboard-powerbi/Power BI/Hotel Booking Demand v2.pbip - Dashboard data export
dashboard-html/_export_data.py - Executive dashboard · Static dashboard with separate application state, charts, and range interaction.
dashboard-html/index.html - SCQA narrative report
reports/html/scqa_data_storytelling.html
Connections 24
- Curated booking data → Star-schema builder: input
- Star-schema builder → Normalized bookings: writes
- Star-schema builder → Monthly proxy RevPAR: writes
- Curated booking data → Cleaning and KPI derivation: analyzed by
- Cleaning and KPI derivation → Cancellation and ADR EDA: feeds
- Cancellation and ADR EDA → Demand and revenue forecasting: informs
- Demand and revenue forecasting → City/Resort elasticity: demand inputs
- City/Resort elasticity → Pricing optimization: elasticity inputs
- Pricing optimization → Scenario validation: validates scenarios
- Curated booking data → Cancellation model: training data
- Cancellation model → Risk-tier threshold policy: calibrates tiers
- Cancellation model → False-positive reduction policy: controls false positives
- Risk-tier threshold policy → Dynamic pricing playbook: buffer and friction guidance
- False-positive reduction policy → Dynamic pricing playbook: refines policy
- Scenario validation → Dynamic pricing playbook: validated pricing guidance
- Dynamic pricing playbook → Implementation guide: operationalizes
- Normalized bookings → SQL Server star schema: imports
- SQL Server star schema → SQL business questions: queries
- Normalized bookings → Power BI semantic model: local CSV refresh
- Monthly proxy RevPAR → Power BI semantic model: local CSV refresh
- Power BI semantic model → Power BI report: renders
- Normalized bookings → Dashboard data export: exports from
- Monthly proxy RevPAR → Dashboard data export: exports from
- Dashboard data export → Executive dashboard: refreshes data