Derver
Applied machine learning / Recommender System

From behaviour
to useful choices.

Itinerary Signals — Derver

An experiment in travel.
A way to investigate how recommendation can support a decision.

Explore the study

01 / The question in the data

An unfinished
itinerary.

Observe the journey.
Hide its last city.
Recommend four possible endings.

The experiment starts with a practical goal: generate a correct destination recommendation for a multi-stop trip. Using the earlier stays in the observed itinerary, we suggest destinations for its unknown final stop. This gives us a bounded way to investigate how behavioural sequences can inform a ranking.

Three observed cities and a hidden endpoint Illustrative itinerary A, B, C, followed by an unknown final city. The model sees all three earlier stays. A B C ? Origin Observed Latest Hidden
Reservations
1,166,835
Trips
217,686
Users
200,153
City IDs
39,901

The trip acts as a recommendation session. Bookings are implicit positive feedback, and anonymous city IDs carry no coordinates. We learn relationships from behaviour, while recognising that an unobserved destination does not establish dislike.

This separates two questions: what someone did, and what would help them. The recorded endpoint is a usable prediction target. A commercial recommender would need an explicit definition of usefulness and a way to test it.

What is the model allowed to know?

Every earlier city, hotel country and stay duration, plus six fields supplied with the final reservation: booker country, device, affiliate, check-in month, weekday and duration. The final city and final hotel country are excluded. Dates describe stays, not booking timestamps; user and trip IDs support grouping and validation, not predictive embeddings.

02 / Statistical evidence

Different cities.
Different roles.

Start with a reference.
Ask what it misses.
Make the next assumption explicit.

The first reference uses directed later-stay counts from every prefix city, weighted by recency. We then separate seven patterns: how cities function as origins, endings, route interactions and return stops, and how reservation context changes the evidence. Each expert scores the same catalogue.

01 / LagEvery earlier stay

Learn directed later-stay patterns from the full prefix. Keep separate evidence for cities one, two, three or four-plus stays apart, and give recent prefix stays more weight.

02 / TerminalWhere trips end

Estimate how frequently each city is the true endpoint. A city’s role as an ending can differ from its overall booking popularity.

03 / OriginWhere trips begin

Estimate the endpoint conditional on the first city. The origin remains informative even after several intervening stays.

04 / Recent routeThe last two cities

Treat the last two observed cities as a joint route pattern. Their combination can carry information beyond either city on its own.

05 / Visit returnA familiar stop

Estimate the chance of ending in a city already visited. Count each city once per trip when measuring return opportunities, so repeated stays do not inflate the evidence.

06 / Origin returnBack to the beginning

Model round-trip structure explicitly: the probability of finishing where the trip started.

07 / ContextThe final reservation

Correct the lag distribution using the six permitted final-row context fields, without observing the concealed city or its hotel country.

Two trips are a weak basis for a confident prediction. Smoothing combines small sets of observations with broader travel patterns, then relies more on the specific pattern as evidence grows. We also keep the observation counts, allowing the blend to consider how much evidence sits behind each estimate.

The transferable question is whether items play different roles. A repeat purchase could be replenishment; a revisited document could be a reference. Those are hypotheses for new domains. Here, the roles are defined and tested within trips.

03 / The neural extension

Read the whole
journey.

Specify the patterns we understand.
Learn interactions we have
not put into count tables.

A gated recurrent unit (GRU) is a neural network that reads a sequence one step at a time. As it moves through the stays, it updates a compact memory of the journey, using learned gates to retain useful earlier information and incorporate each new stop. Here, that memory helps score possible destinations using the order of the itinerary and patterns spanning several stays.

  1. Represent each stay

    City embedding (32), hotel-country embedding (8) and log stay duration are projected to a 32-dimensional token.

  2. Read the itinerary

    A one-layer gated recurrent unit (GRU), width 32, reads every observed stay. First, last and penultimate stay vectors remain explicitly available.

  3. Add the context

    Six context embeddings and five trip summaries describe the final reservation, trip length, distinct cities and stay durations.

  4. Score every fitting city

    A 64-unit layer produces a 32-dimensional trip vector. Its dot products with the shared input/output city embeddings produce a full-catalogue city softmax.

  5. Combine the evidence

    A regularised linear softmax gate uses 13 observable support and agreement features to blend the GRU with the seven statistical experts.

½ lag + ½ learned mixture

The gate uses support counts and agreement between experts to adapt the mixture to each trip. It is fitted on destination log loss with L2 penalty 0.01. A fixed design constraint reserves at least 50% for lag; the residual includes all eight experts.

Mean expert weights / Public benchmark
Lag50.00%
GRU48.36%
Other experts1.64%

04 / Testing the design

Make the comparison
credible.

A new layer earns its place
through a fair comparison
with what came before.

Development holds out 20% of users, keeping each user’s trips on one side. Inside the fitting population, three user folds create out-of-fold predictions for training the gate.

Three inner folds / Entire users stay together
Group AGroup BGroup C Round 1ScoreFitFit Round 2FitScoreFit Round 3FitFitScore

Both the statistical experts and GRU follow those same folds. The gate sees held-user probabilities for at most 20,000 users; other-fold users still supply fitting evidence. Vocabularies, counts and weights are fitted within each fold.

Training uses one true endpoint per eligible trip, with the same prefix and permitted context as prediction. GRU training uses cross-entropy, AdamW, 12 epochs, learning rate 0.001, batch size 128 and gradient clipping 5.

After fitting the gate, refit the experts on all fitting users. Rank the full catalogue, including earlier stops, and return four distinct cities. There are no sampled evaluation candidates or injected targets.

Holding out users tests generalisation across people. It does not reproduce future demand. A live service would also need later-period evaluation and a check that every context field is available when the recommendation is requested.

05 / What changed

What the layers
added.

An incremental improvement.
Evidence for the design,
with a clearly defined scope.

HitRate@4 / Comparing the modelling layers
ModelDevelopmentPublic
Lag reference47.20%48.39%
Statistical blend49.18%50.52%
GRU hybrid50.37%51.73%

Development covers 43,647 held-user trips; the public benchmark covers 70,662 trips. The hybrid recovers 36,553 public endpoints, with NDCG@4 of 42.00%. It adds 854 correct endpoints over the statistical blend.

HitRate asks whether the destination appears in the list. NDCG also rewards placing it nearer the top: with one relevant city, a hit at rank r scores 1 / log₂(r + 1).

Public gain over the statistical blend

+1.21 percentage points

Exploratory 95% interval: +1.03 to +1.40 pp. Based on 2,000 paired user-cluster bootstrap resamples, retaining the dependence between trips from the same user.

How to read these results

These comparisons measure the combined designs, not the isolated effect of every feature. Results come from the original full run, and public labels were previously inspected. They provide descriptive evidence of endpoint reconstruction, not an independent test, an official challenge placing or measured commercial uplift.

06 / Application hypotheses

Where could this
be useful?

The method suggests possibilities.
Each needs its own data,
objective and evidence.

A travel-planning service could investigate whether these signals help people find feasible next stops. That would require geography, dates, live inventory and eligibility rules. It would also need to train with the information available during planning, which can differ from the benchmark’s final-row context.

The same design questions arise elsewhere: what does the sequence mean, what roles do items play, which candidates are eligible, and which outcome would make the recommendation useful? The following are application hypotheses; no cross-domain or online evaluation was performed here.

01 / Product discovery

A shopping session may mix exploration, complementary purchases and replenishment. Role-specific evidence and a sequence representation could be tested together to rank eligible next products.

That needs views, baskets, purchases and recommendation exposures, with stock and compatibility constraints. The commercial hypothesis is more useful product discovery; a controlled comparison should measure purchases and returns, alongside user satisfaction.

02 / Knowledge work

A sequence of searches, opened documents and revisits may reveal a task in progress. Document roles and session patterns could inform the next useful resource.

The candidate set must respect permissions and freshness. Relevance judgements and task-completion measures would test whether suggestions reduce search effort. More clicks alone would not establish that they helped.

03 / Learning resources

Topic progression, practice attempts and revision are different kinds of evidence. A hybrid could investigate which resource is a suitable next step given a learner’s recent activity.

Prerequisites and appropriate content define eligibility. Learning progress and assessment outcomes would need to be measured; the travel experiment provides no evidence that this architecture improves them.

From a ranking model to a useful service

Define the user decision and product objective first. Build the eligible catalogue, log what was shown as well as what was selected, compare domain-specific baselines, and test later periods where appropriate. Offline ranking can screen designs; a controlled online test is needed to estimate changes in user outcomes and business value.

07 / Open the work

Check the code.

Applied machine learning / Information modelling

Itinerary
Signals.

From behaviour to useful choices.

The study

Use a multi-stop trip’s earlier stays to rank four possible final cities. The task offers a bounded experiment in how behavioural history can inform a recommendation.

The methodology

Start with route counts. Add city roles, returns and context. Combine small samples with broader travel patterns, and retain observation counts to show the evidence behind each estimate.

A GRU reads the itinerary in order, updating a memory that retains useful information from earlier stays. This helps score destinations using patterns spanning several stops.

Blend these signals using predictions for users held out when fitting the experts. Whole-user validation and full-catalogue ranking keep the comparison visible and reproducible.

What the layers added

Public HitRate@4 moves from 48.39% for lag evidence to 50.52% for the statistical blend, then 51.73% for the GRU hybrid.

The GRU adds 854 correct endpoints across 70,662 public trips. This is incremental offline evidence. Public labels were previously inspected; no online or commercial uplift was measured.

Possible applications

Product discovery, knowledge work and learning resources offer hypotheses for combining item roles with sequence patterns. Each requires new data, eligible candidates and an outcome that reflects usefulness.

These applications have not been tested here. The transferable element is the methodology; the trained city model and its scores are specific to this dataset.

Open the work

↘ Check the code and methodology

↘ Official dataset

↘ Back to Derver