Meet Otto

Our Methodology

How L'Ottobahn combines crowd predictions and ML for rail reliability analysis


System Architecture

L'Ottobahn ingests data from DB Timetables API (real-time), Zugfinder.net (historical delays), GTFS.de (schedules), and Open-Meteo (weather). PostgreSQL and Redis store predictions and caches. The prediction engine runs LightGBM (26 features) via ONNX inference; human and AI predictions are resolved against actual departure delay. The analytics layer computes Human Bias Index, AI Error Residual, and the Rail Entropy Score (RES) per corridor.

Stack: Next.js, TypeScript, React 19 (frontend); Rust, Axum, SQLx (backend); Python, LightGBM, ONNX (ML). <10ms inference latency.


Data Sources

Historical: Zugfinder.net (long-distance delays, 12 stations), validated and deduplicated. Enrichment: GTFS.de (CC BY 4.0) for scheduled departures and stop counts. Weather: Open-Meteo (temperature, wind, precipitation). Real-time: Deutsche Bahn Timetables API for resolution. Lookups (route mean delay, station means) are precomputed at training and loaded at inference — no DB calls during prediction.


Prediction Model

LightGBM gradient boosting with Huber loss. 26 features in five tiers: temporal/route (8), route aggregates and DB API (8), lag features (3), contextual and weather (6), demand pressure (1). Hyperparameters scale with data size; for N ≥ 2000, Optuna-optimised values (n_estimators=2200, num_leaves=159, learning_rate=0.073). Exported to ONNX, in-process inference. When live DB delay is available, prediction blends 0.8× DB + 0.2× model.


Crowdsourced Intelligence

Users submit a delay estimate (minutes) before departure. Resolution uses actual departure from DB API. Outcome: WIN if |user − actual| < |AI − actual|, LOSS otherwise. Scoring rewards accuracy, divergence from AI (risk-taking), and early prediction. Derived metrics: Human Bias Index (HBI) — mean signed error of crowd; AI Error Residual (AIRS) — mean signed error of model; Structural Instability Score (SIS) — variance weighted by crowd miscalibration.


Rail Entropy Score

RES is a composite metric for corridor fragility: RES = w₁×V + w₂×C + w₃×R + w₄×D. V = normalized delay variance; C = cascading index; R = recovery time; D = perception divergence (|HBI| normalized). Default weights (0.35, 0.25, 0.20, 0.20). RES 0.0–0.3 = stable; 0.6–0.9 = fragile; 0.9+ = structurally unstable. RES is for validation and research only; it is not used in the Inspector model for predictions.


Author

Leonardo Hax Damiani LinkedIn


Play L'Ottobahn