Two-stage TPS forecast
A classifier decides whether a hotel will hold the top slot. A regressor sizes the share. Final TPS is the product, so zeros stay zeros.
Predict Top Position Share at hotel-and-date level, then set CPA and discount inside commercial bounds — and ship a CSV operations can upload to Trivago.
| Hotel | Date | CPA | Discount | Margin |
|---|---|---|---|---|
| 19755 | 23 Dec | 7.20% | −0.60 | OK |
| 21915 | 23 Dec | 7.80% | −0.90 | OK |
| 338961 | 24 Dec | 7.35% | −0.78 | OK |
One pipeline, every step of the bid
The same 102 features at train and serve. Two LightGBMs. Constraints applied before the file leaves the building.
A classifier decides whether a hotel will hold the top slot. A regressor sizes the share. Final TPS is the product, so zeros stay zeros.
CPA 7–10%, discount −15% to 0%, margin ≥ 10%. Illegal rows are dropped before upload — not left for ops to catch.
Every run writes a comparison file next to the Trivago CSV, so bidding teams can see where the model diverges from city heuristics.
Oct–Dec 2025 test split, plus 26 Dec city averages (25 cities, ≥10 hotels), matching the client’s own analysis.
From first hotel-day to an upload file in three steps.
Join Trivago performance, rate insights, and the discount archive on hotel ID and date. Build lags, rolling TPS, and calendar features.
Talk to us →Classify TPS > 0, regress the value, map the forecast to CPA and discount inside the commercial box, enforce margin.
Talk to us →Future dates clone the latest hotel row. Output is hotel_id, date, cpa, discount — plus an ML vs rules file and a run report.
Talk to us →Built for Trivago US POS hotels that need cheaper bids without dumping rate.
City-average CPA 7.35% vs 8.54% on rules — about 14% lower, without a harsher discount.
Zero-TPS hotel-days do not get a made-up discount. Those rows stay NA, matching ops extracts.
Zero CPA and discount bound violations on Dec 16–27 production windows. Margin failures dropped pre-upload.
Percentages, two decimals, the columns Trivago expects — not an internal research table.
From first ring of Athena to a Lambda that can sit behind the existing optimizer API.
Feature prep, base and constrained LightGBM, notebooks, serialized models, importance reports.
Future-date pipeline, last-14-day clone, comparison CSV, run HTML report.
React UI and Flask API to pick dates, run the job, and chart CPA, discount, and margin.
Containerized Lambda package so recommendations can be served as an API, not only a laptop script.
Everything a bidding or data team usually asks before the first upload.
CPA 7–10%, discount −15% to 0%, margin at least 10%. Rows that fail margin are dropped before the Trivago file is written. Production runs in December had zero CPA and discount bound violations.
If the window starts today or later, the pipeline pulls the last 14 days of history, clones the latest hotel row onto each requested date, and refreshes calendar features (day of week, month).
Columns are hotel_id, date, cpa, discount. CPA and discount are percentages with two decimals — the format operations already use, not a decimal from an internal API.
On 26 Dec, across 25 cities with at least 10 hotels, ML CPA averaged 7.35% vs 8.54% for rules, with a milder discount (−0.78 vs −0.92). Each run also writes a full hotel-level comparison CSV.
Have questions?
Product walkthroughs, date-window runs, or a fork of the delivery package.
Location
522 W Riverside Ave, Spokane, WA 99201