Built to order

Hotel Booking Cancellation Prediction using Machine Learning

This project predicts which hotel reservations are likely to be canceled — while there is still time to save them — using the Hotel Booking Demand dataset of 119,390 real bookings from a resort and a city hotel. A gradient-boosted tree model learns from booking-time features only (lead time, deposit type, guest history, market segment), with a strict leakage audit that excludes anything known only after the outcome. An interactive demo scores any booking and suggests the right intervention, from a personal confirmation message to a deposit incentive. Suitable for B.E./B.Tech final-year

Hotel Booking Cancellation Prediction using Machine Learning — project thumbnail preview
More project photos (2)

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

  1. The 119,390 bookings (H1 resort + H2 city) are loaded; the leakage audit removes every column unknowable at booking time.
  2. Remaining features (lead time, hotel, market segment, deposit type, guest history, ADR, special requests…) are encoded.
  3. A gradient-boosted classifier trains with stratified cross-validation; class weighting handles the canceled minority.
  4. Evaluation reports AUC, precision/recall at the operating threshold and calibration — can the hotel trust the probabilities?
  5. Feature-importance and partial-dependence analysis reveal what actually drives cancellations, documented for the report.
  6. 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.

Download abstract (PDF)

Related guides

All guides
Illustration of object tracking showing video frames with bounding boxes and persistent ID labels following people and vehicles, comparing motion prediction and appearance matching.B.E./B.Tech Computer Science and Electronics students building video analytics projects — people counting, vehicle tracking, sports analysis — who have detection working and need

Object Tracking: DeepSORT and ByteTrack Explained

Detection finds objects per frame; tracking keeps their identities across frames. This guide explains tracking-by-detection, Kalman motion models, DeepSORT's appearance embeddings vs ByteTrack's low-confidence box recovery, tracking metrics (HOTA, IDF1, ID switches), and the tuning parameters that determine real-world quality.

Read guide
Illustration of image segmentation showing U-Net's U-shaped encoder-decoder with skip connections producing pixel masks, alongside Mask R-CNN detecting instances with masks.B.E./B.Tech Computer Science and AI/ML students moving from image classification or detection to pixel-level understanding — medical imaging, defect detection, autonomous driving

Image Segmentation: U-Net and Mask R-CNN

When projects need pixel-level answers, segmentation delivers. This guide explains semantic vs instance vs panoptic segmentation, U-Net's encoder-decoder with skip connections, Mask R-CNN's parallel mask head, Dice and IoU evaluation, paired augmentation, and how to choose the right architecture for your data and question.

Read guide
Illustration of Whisper speech-to-text showing sound waves flowing into a neural network and emerging as transcribed text with timestamps and speaker labels.B.E./B.Tech Computer Science and AI/ML students adding speech-to-text to projects — voice assistants, meeting transcription, accessibility tools

Whisper for Speech-to-Text in Student Projects

Whisper transcribes speech in dozens of languages with no training required. This guide covers how it works, choosing among model sizes, running it locally with faster-whisper, handling hour-long audio, timestamps and speaker diarization, multilingual quirks, and honest evaluation with word error rate.

Read guide
Get a quotation