Case 04 / 04 · 2023
Forecasting Reservation Ratings
A machine-learning early-warning model: predict, from what a guest gives at booking, which reservations will rate below a hotel's average — so the hotel can fix the stay before the review is ever written.
- Python
- scikit-learn
- XGBoost
- Keras
- pandas
- BeautifulSoup
- NLTK
01 · The problem
A hotel's online rating is its reputation, and a single below-average review drags it down. But by the time a low rating is posted, it is already too late to act. My master's thesis (Åbo Akademi University, 2023) asked whether that low rating could be seen coming — predicted from the only thing known before the stay: the data a guest gives when they book.
The target hotel is the Radisson Blu Seaside in Helsinki. The idea is an early-warning model: flag a reservation likely to rate below the hotel’s own average, while the guest can still be moved to a better room or have a problem pre-empted — and pair it with a review analysis that tells managers exactly what tends to go wrong.
02 · Architecture
Scrape
Booking.com reviews
BeautifulSoup pulls 5,885 reviews of one Helsinki hotel; 33 languages are detected and translated to English.
Prepare
Binarize at 8.4
The rating is split at the hotel's own 8.4 average — below-average is the class to catch. Five booking-time fields become the features.
- Country
- Room type
- Nights
- Check-in month
- Travel type
Model
124 tuned models
Four algorithms × 31 feature subsets, each hyperparameter-tuned and ranked by the custom TN-score:
Act
Before the guest arrives
A reservation flagged below-average is one a manager can still rescue. A parallel NLTK review analysis names what to fix.
- Room cleanliness
- Bedding comfort
- Breakfast quality
→ Protect the rating
TN-score — purpose-built for asymmetric costs: it rewards catching genuine below-average reservations while penalizing false alarms.
03 · How it works
-
Scrape and normalize
A BeautifulSoup scraper collects 5,885 public reviews of the hotel from Booking.com. The reviews span 33 languages, so a translation step folds them all into English before any analysis — a clean, comparable corpus from a messy public source.
-
A target the business cares about
The 0–10 rating is binarized at 8.4 — the hotel’s own average — so the model predicts a single, decision-ready class: will this reservation drag the average down? Five booking-time fields (country, room type, nights, check-in month, travel type) are the only predictors, because they are all that is known in advance.
-
124 models, not one
Four algorithms — logistic regression, random forest, XGBoost, and a neural network — are each trained across all 31 feature subsets and hyperparameter-tuned: 124 models in total, compared on equal footing to find which signal and which method actually carry the prediction.
-
A metric built for the cost
Accuracy is the wrong objective here: the classes are imbalanced and the costs are asymmetric. So I designed TN-score — it rewards catching genuine below-average reservations while penalizing false alarms, because a missed warning and a wasted intervention cost the hotel very different things.
04 · Model & results
- problem
- Predict, at booking time, whether a future reservation will rate below the hotel's 8.4 average — a binary, cost-asymmetric classification on data known before the guest arrives.
- data
- 5,885 Booking.com reviews of the Radisson Blu Seaside, Helsinki, scraped with BeautifulSoup and translated from 33 languages to English; missing rows dropped, categoricals one-hot encoded.
- features
- Five PNR (booking-record) fields — country, room type, nights, check-in month, travel type — searched across all 31 non-empty subsets.
- model
- Logistic regression, random forest, XGBoost, and a Keras ANN, each tuned across every feature subset (124 models) and ranked by a custom TN-score. A 6-layer ANN on {room type, travel type, check-in month, nights} won.
- 0.55 Best TN-score (ANN)
- 60% Below-average reservations caught
- 124 Models trained & tuned
- 5,885 Reviews scraped & analysed
The best model caught 60% of below-average reservations — but catching more of them also raised false alarms, so its precision stayed near 50%. The honest finding: booking-time data alone does not reliably predict a guest’s eventual rating, because satisfaction is shaped by what happens during the stay. The contribution is the framing and the method — a decision-ready target, a custom cost-aware metric, and an exhaustive, honestly-reported model search.
05 · Outcome
Alongside the predictive model, an NLTK text analysis of the reviews gives managers the other half of the answer: across thousands of comments, the recurring complaints cluster on room cleanliness, bedding comfort, and breakfast — concrete levers to pull when a reservation is flagged, or simply to raise the baseline.
The thesis lands on a mature conclusion rather than an inflated one: it maps a real problem end to end, builds the data and the metric to fit the business cost, and reports a result that says as much about the limits of the data as the power of the model — the judgment a data role actually runs on.
Ask the assistant about this