What the missing rows taught me about metro forecasting
The Istanbul smart card sample looked like a month of data. Six days of it were real, and that fact shaped the model more than any hyperparameter did.
The dataset behind my bachelor thesis was a month of smart card transactions from the Istanbul metro. After filtering to line M2 and grouping by date, hour, and station, it came to 3,982 rows. A complete month would have held 21,576.
That is 18 percent coverage, and the missing 82 percent was not spread evenly.
Six real days
Exactly six dates were logged across the full service day: 1, 25, 27, 28, 30, and 31 August. Every other date in the file carried between nine and twenty-seven rows, usually a single hour at a handful of stations, with whole-line daily totals as low as twenty-one passengers.
Those are not quiet days. A metro line does not carry twenty-one people. They are outages, and they sat in the training set looking exactly like observations.
Why it matters more than the architecture
The network was two GRU layers and an LSTM, 48,901 parameters, reaching an R² of 0.86 on the test split. I spent a long time on that architecture. In hindsight the larger lever was sitting in the input.
A simple lookup table keyed on station, hour, and a weekend flag reaches R² 0.74 on the same test rows. Most of the signal in urban transit demand is a daily rhythm repeating station by station, and almost any method finds it. What separates a good model from a mediocre one is whether the gaps have been identified first.
The trap that looks like a feature
Splitting the lookup further, down to individual days of the week, makes the result much worse: R² drops to 0.05. With only six well-recorded dates, each station, hour, and weekday cell rests on a single observation. The averages become noise wearing the costume of precision.
The network avoids this because it reads a twelve-step history rather than a single cell. It is not that it understands the data better. It is that its input shape happens to be less brittle under sparsity.
What I would do differently
Drop the near-empty dates before training. It is the most direct improvement available and I did not do it, which means part of what the network learned to fit was the shape of missing records rather than passenger behaviour.
There is a lesson underneath this that generalises past transit forecasting. Data quality work is unglamorous and it is usually where the accuracy actually lives.