Two ML Cases: Predicting Flight Lateness and Screening Faces Against a Watchlist
Machine LearningModel answerLast updated
Design two ML systems end to end: a regression model forecasting flight departure lateness two hours out, and an open-set face-matching pipeline that flags watchlist individuals at a bank entrance.
You are asked to walk through two applied machine-learning design cases. For each, cover the modeling approach and the business and ethical trade-offs.
Case 1: Forecasting departure lateness
An airline wants, for every scheduled flight, a prediction of how many minutes late it will push back. The prediction must be made 2 hours before scheduled departure. Available data includes past flight operations, airport congestion, aircraft and route attributes, weather forecasts, and crew and maintenance indicators.
Assume lateness is right-skewed, severe delays are rare but expensive, and each hub runs under different operating policies.
Propose a regression-based solution and discuss:
- How you define the target and prevent label leakage.
- Which features you would build.
- How you split data over time for training and validation.
- Which metrics you would use (for example MAE, RMSE, quantile loss) and why.
- How you treat missing values, outliers, and strongly correlated inputs.
- Whether multicollinearity hurts prediction, interpretability, or both.
- What correlation level you would call "high" and why.
- Alternatives to dropping correlated features (regularization, feature clustering, PCA, tree models).
- How you would estimate the business impact of removing a feature.
- How you would turn predictions into concrete operational actions.
Case 2: Screening entrants against a watchlist
A bank wants to analyze branch camera feeds and flag when someone entering matches a watchlist of known robbers. Describe the model and the decision system around it, including:
- Closed-set versus open-set recognition.
- Data collection and labeling.
- Very low base rates and class imbalance.
- Relative costs of false positives and false negatives.
- Threshold choice, calibration, and human review.
- Fairness, privacy, consent, and legal exposure.
- Latency, and edge versus server inference.
- Monitoring for drift, spoofing, and adversarial attacks.
Hints
Hint 1
For the lateness model, write down exactly what is known at T-2h. Every feature must be an as-of snapshot, so use forecasts rather than observations and estimated rather than actual inbound arrival times.
Hint 2
Because severe delays are rare and costly, think beyond a single point estimate: predicting the median plus a high quantile (such as P90) maps naturally onto buffers and proactive actions.
Hint 3
For the watchlist case, ask what fraction of people entering are truly on the list. That base rate dominates precision, so reason with it before choosing a threshold, and keep a human in the loop before any consequential action.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Both cases test whether you can turn a loose business request into a well-posed prediction problem, avoid leakage and base-rate traps, and link model output to decisions with real costs. State assumptions, use numbers, and raise ethical and operational limits unprompted.
Case 1: Lateness forecasting
Target and leakage
- Target: actual pushback time minus scheduled departure, in minutes, predicted at T-2h. Decide whether early departures are clipped to 0 or kept negative; operations usually care only about lateness, so clipping is reasonable.
- Cancellations and diversions have no valid delay. Do not encode them as huge delays. Use a separate cancellation classifier or treat them as censored.
- Leakage control: build every feature as a snapshot at T-2h. Use forecast weather, not observed. Use the inbound aircraft's estimated arrival at T-2h, not its actual arrival. Exclude taxi-out time, later gate changes, and full-day aggregates. Compute historical route statistics and target encodings only from data before the prediction date.
Features
- Delay propagation (usually strongest): inbound aircraft's current estimated delay, turnaround slack (scheduled turn minus minimum turn), position in the aircraft's daily rotation.
- Congestion: scheduled movements per hour at origin and destination, ground-delay programs, runway configuration.
- Weather forecasts: ceiling, visibility, wind, convective probability at origin, destination, and the inbound origin.
- Crew and maintenance: connection slack, duty-time headroom, open deferred items, aircraft type and age.
- Calendar and history: hour, weekday, holidays, rolling delay quantiles per route, hub, and hour.
- Hub policy: hub ID with interactions, or per-hub or hierarchical models.
Validation
Use rolling-origin (expanding window) validation: train on months 1..k, validate on k+1. Leave a gap so lagged features cannot leak, and keep whole days in one fold since same-day flights share weather and propagation. Ensure validation includes summer convective and winter storm periods, and report per-hub metrics.
Metrics
| Metric | Role |
|---|---|
| MAE | Robust headline, median-oriented |
| RMSE | Punishes large misses that are costly; outlier-sensitive |
| Pinball loss at P50/P90 | Matches how operations plan buffers |
| P90 coverage | Calibration: does P90 cover roughly 90%? |
| Precision/recall for >60 min | Business view of rare severe events |
For skew, consider a hurdle model (P(delay>15) times expected delay given late), a log or Tweedie target, or quantile gradient boosting.
Missing data, outliers, correlation
- Missing: add missingness flags (a missing forecast at a small airport is informative); use GBM native handling or hub-hour median imputation.
- Outliers: remove data errors (impossible timestamps, cancellations logged as delays) but keep genuine extreme delays, since they are the signal. Use Huber or quantile loss for stability.
- Multicollinearity: mostly harmless for prediction if the correlation structure is stable in production. It hurts interpretability: linear coefficients become unstable or flip sign, and importance gets split across correlated features. It is also a robustness risk if one correlated feed fails.
- "High" correlation: a practical flag is |Spearman| above 0.8-0.9 or VIF above 5-10. Spearman catches monotone non-linear links. It is a heuristic; check whether the features mean different things operationally and whether removal changes validation loss.
- Alternatives to dropping: ridge or elastic net; cluster features on |rho| and keep one representative; PCA (accurate but hard to explain); tree ensembles; grouped permutation importance or grouped SHAP.
Business impact of removing a feature
- Retrain without it (ablation). Permuting is misleading because correlated substitutes absorb the effect.
- Compare loss on identical temporal folds with bootstrap intervals and per-hub breakdowns.
- Convert the loss change into cost by running the decision simulation: extra missed severe-delay alerts times cost per misconnect, crew overtime, or needless swaps.
- Compare against the feature's acquisition, latency, and reliability cost.
From predictions to actions
- Use P90 to trigger proactive steps: aircraft swaps, calling reserve crew, gate reassignment, early rebooking of tight connections.
- Use P50 for customer-facing estimated times.
- Set per-hub thresholds from a cost matrix (cost of unnecessary action versus unmitigated delay).
- Show top drivers ("inbound 40 min late", "ground-delay program") so controllers trust alerts.
- Validate in shadow mode, then A/B test by station or day.
Case 2: Watchlist face matching
Framing
Nearly everyone entering is not on the list, so closed-set classification (forcing every face into a known class) is wrong. Use open-set 1:N identification: an embedding model (ArcFace-style, fine-tuned for CCTV) with nearest-neighbor search over gallery templates, rejecting anything below a similarity threshold as "unknown."
Data and labeling
- Gallery: images from law enforcement or court records with a documented legal basis and a removal process.
- Model: do not train from scratch; use a vetted, licensed model. Fine-tune or evaluate on consented, domain-matched footage covering low resolution, overhead angles, masks, and lighting.
- Labels: verified mated and non-mated pairs, per-face quality scores, and demographic annotations used only for auditing.
Base rate and costs
Suppose 1 in 100,000 entrants is truly listed and the system has a 0.01% false-match rate with 90% recall. Per million entrants, about 10 are listed and ~9 are caught, but ~100 innocent people are falsely matched. Precision is below 10%. So alerts cannot trigger automatic action; they must go to human review.
- A false positive means a wrongly accused customer, reputational and legal harm, and possible discrimination claims.
- A false negative means a missed threat, but the system is only one layer of security.
Choose the threshold from this cost asymmetry, usually favoring a low false-match rate, and evaluate with ROC/DET curves at very low FPR, not accuracy.
Calibration and review
Calibrate scores (for example per quality bucket) so a score maps to a real match probability. Use tiers: high-confidence alerts go to a trained reviewer who compares the images, then follows a protocol that does not escalate to confrontation. Low-quality faces get a higher threshold or no alert. Log all decisions for audit.
Fairness, privacy, legal
- Measure false-match rates per demographic group (NIST-style testing) and block launch if gaps are unacceptable.
- Check biometric laws (consent and notice requirements, for example BIPA or GDPR special-category rules), and many jurisdictions restrict this use. Get legal sign-off.
- Minimize retention: discard non-matching embeddings immediately, encrypt the gallery, restrict access, and provide an appeal path.
Latency and deployment
Alerts must arrive within a couple of seconds. Run detection and embedding on edge devices at the branch (low latency, raw video stays local), and send only embeddings or flagged crops to a server for gallery search and review. Server-only inference adds bandwidth, privacy exposure, and outage risk.
Monitoring
- Track score distributions, quality, and alert rates per branch to detect drift (new cameras, seasons, masks).
- Add liveness and presentation-attack detection against photos, screens, and masks; test against adversarial patches.
- Sample reviewed alerts for ongoing precision estimates and retrain or re-threshold on a schedule.
Common mistakes
- Using observed weather or actual inbound arrival as features.
- Random train/validation splits on flight data.
- Dropping extreme delays as "outliers."
- Reporting accuracy or AUC for the watchlist without discussing precision at the true base rate.
- Treating face matches as identification rather than leads requiring human confirmation.