← All work

[ Analytics case · independent project · 2026 ]

How long should your layover be?

I turned 7 million real 2025 U.S. flights into 4.8 million hub connections, measured how often each one was actually missed, and turned the result into a booking rule and a risk badge for TripMate.

Try it · national risk curve2025 · all 41 hubs
Layover45min
missed10.6%about 1 in 9 connections
≈1.3 points of this is inbound cancellations — no layover fixes those.

The 30-second version

Question
Airlines sell 30–45 minute connections. How often do they fail, what does a miss cost, and which layover gets you there fastest on average?
What I did
Built the dataset from raw DOT files, labelled 4.84M connections from what really happened, tested the patterns, validated a model on months it never saw, and turned it into an expected-cost decision.
Answer
Risk falls from 15.9% at 30 min to 7.6% at 60. A miss costs a median 5.5–8.4 hours, so 45–75 minutes is the fastest choice at almost every hub — evening arrivals need more.
Skills
Python · pandas · scikit-learn · data pipelines · hypothesis testing · out-of-time validation · calibration · decision analysis · product thinking
Role
Solo — question to recommendation
Data
U.S. DOT on-time file 7,001,619 flights · 2025
Tools
Python · pandas · scikit-learn
Deliverable
Risk curve · model · booking rule · badge
connections labelled
4.84M
missed at 30 min layovers
15.9%
AUC on unseen months
0.69
minutes: fastest layover
45-75
01

The question

Booking sites happily sell a 35-minute connection. Nobody tells you the odds.

Airlines publish a minimum connection time and booking engines sell anything above it. For a traveller — and for TripMate, the travel copilot I built — the useful question is different: what is the chance this connection fails, what happens if it does, and which layover is fastest on average once misses are counted? I split it into three questions the data can actually answer.

How risky?

Miss rate by layover, hub, carrier, time of day and season — with confidence intervals.

How costly?

The real wait for the next flight to the same destination after a miss, from the actual schedule.

So what?

The layover that minimises expected travel time, and a risk badge the product can show at booking.

02

Building the dataset

There is no “missed connection” dataset. I built one from what actually happened.

The DOT file lists every domestic flight by the large carriers with scheduled and actual times — but not who connected. So I built realistic itineraries: each inbound flight into a carrier’s hub is paired with that carrier’s next departure 30–180 minutes later, three random layovers per inbound. Each pair is labelled from the real outcome of both flights, so a storm that delays both is captured instead of assumed away.

  1. 017.0MFlights loaded12 monthly DOT files, 18 columns; actual times rebuilt as scheduled + delay
  2. 0241Hubs in scope6 mainline carriers at their own hubs (AA, DL, UA, WN, AS, B6)
  3. 034.84MConnections builtmerge_asof pairing, 3 random layovers of 30–180 min per inbound
  4. 04277kLabelled missed5.73% overall · 95% CI 5.71–5.75%
Labelling ruleFrom real outcomes

missed = inbound cancelled or diverted OR outbound pushed back < 20 min after inbound landed

45-min layover · inbound 10 min lateMade
InboundOutbound
35 min to spare
45-min layover · inbound 40 min lateMissed
InboundOutbound
only 5 min left
45-min layover · both 40 min lateMade
InboundOutbound
correlated delay saves it

20 min gate-to-gate

03

What the data says

Risk drops fast for the first hour, then flattens — and when you land matters as much as how long you wait.

Risk curve4.84M connections
0%5%10%15%30507090110130150170
  • All misses
  • Late inbound only
  • Cancellation floor
Share of connections missed by scheduled layover (min). Shaded band = 95% CI (narrow at this sample size).
A

Going from 30 to 60 minutes halves the risk (15.9% → 7.6%). Doubling again to 120 takes off only 3.8 more points. About 1.2–1.3 points never go away: inbound cancellations that no layover can fix.

Arrival hour45–75 min layovers
00
03
4.806
5.609
5.812
8.415
11.518
13.921
Miss rate by local arrival hour at the hub, for 45–75 minute layovers.
B

Delays pile up through the day. A 7 a.m. arrival misses ~4.8%; after 9 p.m. it’s 13–15% — three times as risky for the same layover.

Season45–75 min layovers
8.0J
7.2F
7.2M
7.6A
8.7M
10.6J
11.4J
8.9A
6.2S
6.7O
8.5N
9.1D
Miss rate by month (%), 45–75 minute layovers.
C

June–July are worst (10.6–11.4%): summer thunderstorms on full schedules. September is the calmest month (6.2%).

Correlated delaysReal vs. shuffled
0%5%10%15%30507090110130150170
  • Real outcomes
  • If delays were independent
Miss rate by layover: real pairs vs. the same pairs with outbound delays shuffled at random.
D

When the inbound is late, the outbound often is too — the same storm, the same crew. Breaking that link predicts 6.66% misses instead of the real 5.73%: the common shortcut of multiplying two delay rates overstates risk by ~16%. Labelling from paired real outcomes was worth the effort.

Why people miss277k misses
78%Inbound latemedian 124 min late when it causes a miss
22%Cancelled / diverted

Delay minutes by reported cause

Late-arriving aircraft42%
Carrier (crew, maintenance)39%
Air-traffic system14%
Weather5%
E

Weather is rarely the direct culprit. Knock-on delays from earlier flights and carrier operations cause four in five delay minutes — which is exactly why late-day arrivals are riskier.

04

Can we predict it?

A model helps — but measured honestly, booking-time data has a ceiling.

If TripMate shows a risk number, it must be calibrated (a 10% badge should fail about 10% of the time) and tested on months the model never saw. I trained gradient boosting on what is known at booking — layover, arrival hour, hub, carrier, origin, weekday, distance — and compared it with two baselines a PM could build in a spreadsheet.

  1. TrainJan–Aug3.22M connections
  2. CalibrateSepisotonic regression
  3. TestOct–Dec1.22M · never seen
ScoreboardTest set · Oct–Dec
ApproachAUCAvg. precisionBrier
Layover only0.6570.0960.0504
Hub × carrier × layover table0.6640.1040.0503
Gradient boosting (calibrated)0.6900.1230.0499
Higher AUC and average precision are better; lower Brier is better. Base rate in the test months: 5.43%.
Calibration10 deciles
0%0%5%5%10%10%15%15%predicted riskobserved
Each dot is a tenth of the test set. On the diagonal = honest. Points sit ~1.5 pts above it: see the note below.
What drives the predictionPermutation importance
Layover length52%
Arrival hour26%
Where you fly in from10%
Hub4%
Day of week4%
Carrier3%
Inbound distance2%
Share of the model’s signal lost when each feature is shuffled (log-loss increase).

Small, real lift

AUC 0.690 vs. 0.664 for the lookup table. Layover and arrival hour carry ~80% of the signal; the rest of the risk is day-of weather and operations nobody knows at booking.

Show bands, not decimals

With this ceiling the product should show Low / Medium / High risk with the % behind it — not a falsely precise score.

A miss I caught

Calibrated on calm September, the model under-predicts Oct–Dec by ~1.5 points. An early version used month as a feature and was worse. Fix: train on 2023–2025 so it can learn seasonality.

05

The decision

A miss costs hours, not minutes — so the fastest layover isn’t the shortest.

For every missed connection I looked up the next real departure to the same destination from that hub that day or the next. Two bounds: any carrier (optimistic) and the same mainline carrier (realistic for most tickets).

5.5-8.4
hours median extra wait
42-51%
of misses wait overnight
Extra wait after a missFrom the real schedule
Any carrier6271848
Same carrier201959
  • < 1 h
  • 1–3 h
  • 3–6 h
  • > 6 h / overnight
Share of misses by extra wait until the next departure to the same destination.
Expected time at the connectionAmerican · Washington DCA · afternoon
0601201804575105135165180fastest
  • Same carrier
  • Any carrier
  • Layover itself
Expected minutes spent at the connection, including the chance of a miss (afternoon arrivals).

expected time = layover + P(miss) × wait after a miss

On American at DCA, a 45-minute connection misses 16% of the time: expected 118–151 minutes. Booking 60–75 minutes is faster on average (115–140) — and far calmer. The answer barely moves between $25/h and $100/h value of time, because the cost of a miss is itself mostly time.

The 16 busiest hubsMiss rate by layover band
Hub30–5960–8990–119FastestOvernight
ATLDL10.96.14.345 min29-30%
DFWAA15.29.97.345-75 min41-43%
CLTAA11.87.15.160 min40-42%
DENUA12.36.64.945-75 min34-57%
DENWN9.35.03.345-60 min35-50%
LASWN8.14.52.645-60 min41-49%
ORDUA10.16.44.460 min33-54%
SEAAS13.76.64.260 min47-59%
BWIWN8.04.53.345 min51-53%
PHXWN8.35.03.345 min44-52%
DALWN8.65.13.645 min53-53%
MDWWN8.54.83.245 min58-58%
MSPDL11.16.34.160 min56-58%
IAHUA10.25.73.945 min46-51%
MIAAA14.48.45.760-75 min45-46%
PHXAA12.57.95.360-75 min37-59%
Miss rate (%) by layover band; fastest = expected-time-optimal layover (range across the two rebooking bounds); overnight = share of misses that wait overnight.
06

Recommendation

Three rules for travellers, one feature for TripMate.

01

Book 45–75 minutes

Fastest on average at almost every hub. Never 30: one in six of those connections fails.

02

Add time late in the day

Arriving after 5 p.m. or flying in June–July? Add 15–30 minutes — risk is two to three times higher.

03

Respect the last flight

Roughly half of misses mean an overnight. If it’s the last connection of the day, book the longer one.

TripMate · connection checkPrototype
BOS → DCA → CLT
45 min High risk · 16%

A 60–75 min connection misses 9–12% and is faster on average.

Source: DOT on-time data 2025 · afternoon arrivals

The model writes a lookup table of calibrated miss probabilities by carrier × hub × arrival time × layover (risk_table.json), small enough to ship to the front end with no model server. In TripMate it becomes a badge next to every connecting itinerary.

07

Limits & next steps

01

One year of seasons

Add 2023–2024 so the model learns month effects instead of under-predicting winter.

02

Mainline only

Regional partners file under their own codes, so connections onto them are out of scope. Next: map partner flights to marketing carriers.

03

A fixed 20-minute rule

Gate-to-gate time varies by terminal. Next: vary it by hub using terminal maps — and by whether you check a bag.

04

Rebooking is approximated

I use the next nonstop to the same destination. Real rebooking may route via another hub (faster) or hit full flights (slower).

Data: U.S. DOT Bureau of Transportation Statistics, Reporting Carrier On-Time Performance, Jan–Dec 2025. Every number on this page is computed by my own code from those files; code available on request.

SAY HI.

Want the notebook, or a walkthrough of how I would put this in front of a product team?