The problem
More than a third of hotel bookings never materialize — guests cancel, rooms sit empty, revenue evaporates. But cancellations are not random: long lead times, no deposit, online-travel-agency bookings and guests with a cancellation history all raise the odds, and the hotel knows all of this at booking time. This project turns that knowledge into a predictor trained on the Hotel Booking Demand dataset (Antonio, Almeida & Nunes, 2019): 119,390 real reservations from a Portuguese resort hotel and city hotel, each described by 31 booking attributes with the canceled-or-not outcome. The central engineering lesson is the leakage audit — several columns (reservation status, assigned room type, booking changes) are only known after the outcome and must be excluded, or the model "predicts" the past. The project documents every excluded column and why, then trains a gradient-boosted classifier on honest booking-time features.
How it works
- The 119,390 bookings (H1 resort + H2 city) are loaded; the leakage audit removes every column unknowable at booking time.
- Remaining features (lead time, hotel, market segment, deposit type, guest history, ADR, special requests…) are encoded.
- A gradient-boosted classifier trains with stratified cross-validation; class weighting handles the canceled minority.
- Evaluation reports AUC, precision/recall at the operating threshold and calibration — can the hotel trust the probabilities?
- Feature-importance and partial-dependence analysis reveal what actually drives cancellations, documented for the report.
- In the demo, a booking's details are encoded and scored live; the app shows P(cancel), the key factors and the recommended intervention.
Tech stack:
- Python 3, scikit-learn / gradient boosting
- Pandas, NumPy (data handling)
- Matplotlib (evaluation plots)
- Jupyter Notebook (training & evaluation)
- HTML5 canvas + JavaScript (interactive demo)
- Hotel Booking Demand dataset (Antonio et al., 2019)
Dataset & model details
- Dataset: Hotel Booking Demand (Antonio, N., de Almeida, A. & Nunes, L., 2019, Data in Brief) — 119,390 real bookings from a resort hotel (H1, 40,060) and a city hotel (H2, 79,330) in Portugal, arrivals July 2015–August 2017, 31 variables, binary is_canceled target.
- Task: Binary classification; input = booking-time feature vector, output = P(cancel).
- Model: Gradient-boosted decision trees on leakage-audited booking-time features only (lead_time, hotel, market_segment, deposit_type, is_repeated_guest, previous_cancellations, adr, total_of_special_requests, …).
- Metrics: AUC ≥ 0.85 (design target for the built-to-order training run), precision/recall at the operating threshold, calibration curve. Published results on this dataset report AUC around 0.85–0.90; no figure is claimed as measured until the training run is executed for the order.
| Parameter | Value |
|---|---|
| Input | ~20 booking-time features |
| Output | P(cancel), risk tier |
| Bookings | 119,390 (H1 + H2) |
| AUC | ≥ 0.85 (design target, not a measured claim) |
| Training time | Approximately 5–15 min on a laptop CPU (expected) |
| Inference | Sub-millisecond per booking on CPU (expected) |
| Model file | Approximately 5–15 MB (expected) |
| Demo | Single-file web app, runs offline after download |
Project features
- [Cancellation-risk classifier] Gradient-boosted trees predicting P(cancel) from booking-time features, trained on 119,390 real reservations.
- [Leakage-audited pipeline] Every post-outcome column (reservation_status, assigned_room_type, booking_changes…) identified and excluded with written justification — a standout viva topic.
- [Interactive booking demo] Enter any booking's details and get its cancellation probability with the exact factors pushing it up or down.
- [Intervention recommender] Risk-tiered actions: personal outreach and deposit incentives for high risk, automated reminders for moderate, nothing for low.
- [Lead-time analysis] The dataset's clearest pattern — longer booking windows cancel more — visualized and quantified for the report.
- [Full training notebook] Cleaning, leakage audit, encoding, imbalance handling, training and evaluation in one reproducible notebook.
- [Exported trained model] Saved model plus the booking-time feature list, so new reservations score without retraining.
What is included
- Complete training & evaluation Jupyter notebook (with leakage audit)
- Trained classifier with booking-time feature pipeline
- Interactive cancellation-risk web demo
- AUC/ROC, calibration and feature-importance plots
- Project report PDF (background, revenue-management context, leakage methodology, results)
- PPT presentation for final review
- Viva Q&A preparation document (leakage, AUC vs accuracy, calibration, intervention design)
Limitations & prerequisites
- Data covers two Portuguese hotels, 2015–2017 — patterns may not transfer to other markets or post-pandemic booking behavior; stated plainly.
- The model predicts risk; whether an intervention actually saves the booking needs A/B testing the project does not run.
- AUC ≥ 0.85 is a design target for the training run, stated honestly — the report documents the actual achieved figure after training.
- The demo's in-browser model is a compact illustration on key features; the full boosted model ships separately.
- No guest-identifying data is used or needed — the dataset is anonymized and the project keeps it that way.
Frequently Asked Questions
Which dataset is used and why?
Hotel Booking Demand — 119,390 real, anonymized bookings published as a data paper in 2019. It is the standard public dataset for cancellation prediction, with rich booking-time features and a well-documented schema.
What is the leakage audit?
Several columns (reservation_status, assigned_room_type, booking_changes) are recorded after the booking's fate is known. A model trained on them scores ~100% and learns nothing. The project excludes them with written justification — the single most important engineering decision in the build.
What actually drives cancellations?
Long lead times, no deposit, online-travel-agency bookings and previous cancellations push risk up; non-refundable deposits, repeated guests and special requests pull it down. The report quantifies each.
How does the demo recommend interventions?
By risk tier: high-risk bookings get personal outreach and incentives, moderate-risk get automated reminders, low-risk get the standard flow — matching what revenue-management teams actually do.
Is the model well calibrated?
Calibration is evaluated explicitly: when the model says 70% risk, roughly 70% of such bookings should cancel. The calibration curve is in the report.
Is this project suitable for a final-year project?
Yes — for AI & Machine Learning, Computer Science and IT programs. It teaches the full applied-ML loop on real business data, with the leakage audit as a genuinely professional-grade lesson. Suitable for B.E./B.Tech final-year projects in AI & Machine Learning, Computer Science and IT.
Components & software requirements
- Python 3, scikit-learn / gradient boosting
- Pandas, NumPy (data handling)
- Matplotlib (evaluation plots)
- Jupyter Notebook (training & evaluation)
- HTML5 canvas + JavaScript (interactive demo)
- Hotel Booking Demand dataset (Antonio et al., 2019)
Dataset & model details
- Dataset: Hotel Booking Demand (Antonio, N., de Almeida, A. & Nunes, L., 2019, Data in Brief) — 119,390 real bookings from a resort hotel (H1, 40,060) and a city hotel (H2, 79,330) in Portugal, arrivals July 2015–August 2017, 31 variables, binary is_canceled target.
- Task: Binary classification; input = booking-time feature vector, output = P(cancel).
- Model: Gradient-boosted decision trees on leakage-audited booking-time features only (lead_time, hotel, market_segment, deposit_type, is_repeated_guest, previous_cancellations, adr, total_of_special_requests, …).
- Metrics: AUC ≥ 0.85 (design target for the built-to-order training run), precision/recall at the operating threshold, calibration curve. Published results on this dataset report AUC around 0.85–0.90; no figure is claimed as measured until the training run is executed for the order.
Delivery information
Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.
Support terms
Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.