The magic of simplicity: how we improved the display of public transport on the map

Ivan Kosolapov12 Dec 2024

Problem

Users of the 2GIS map saw buses jump, vanish and reappear elsewhere, or fly across the city at high speed. Positions come from GPS trackers via an aggregator. Coordinates are inaccurate and arrive every 30 seconds to 1.5 minutes, and the data may not name the route. The team's offline metric showed errors of a few tens of meters, which did not match what the product showed. The existing algorithms were complex and could not be tested locally.

Example from the article: buses jumped and crossed the city at high speed while the offline error stayed at a few tens of meters.

Solution in brief

The team fixed the process before the algorithms. They changed the metric to compare two consecutive forecasts as users see them, cut the data update interval, replaced speed correction with a piecewise-speed forecast that slows buses before stops, built an offline replay setup, and moved smoothing from the app to the server. In stopwatch checks the result beat a competitor.

Questions this case answers
  • How to define an offline metric for a short-horizon position forecast so that it reflects the delay and smoothness users actually experience
  • How to decide whether a prediction quality problem is a lack of input information, not a model-complexity problem, and fix the data before adding models
  • How to build an offline replay setup for a real-time correction system so that metric changes can be attributed to a code change
  • How to choose an offline metric for a vehicle-position forecast that matches what users see in the app?

Tools and methods

  • Forecast-to-forecast metric — meters between the previous and the fresh forecast
  • Shorter forecast horizon — update interval 30 s to 10 s
  • Piecewise speed forecast — route split into pieces with own speeds and stop slowdowns
  • Python replay tools — dataset from real tracks, algorithm run, metrics offline
  • Stopwatch field check — MAE of bus arrival at stops, against a competitor
Continue reading — it's free

Google or a one-time email code. No password.