transit-peak-hour-drift-detection / charts

When does rush hour really start?

Historical estimates, replayed as a stream. Three months (March to May 2024) of estimated 5-minute boarding counts for 10 Salvador bus stops, from the SUNT dataset (CC BY 4.0).

Six-person group project for COMPX523 at the University of Waikato. Necmi Kural's part was Role D: the adaptive boundary detector, the ADWIN and Page-Hinkley drift tests and the schedule alignment. Full credit for every role is in the README.

Detected peak start against the official window

From the README, verbatim: the online adaptive-threshold detector with CapyMOA ADWIN, Kaggle run recorded in outputs/D_drift_findings.md.

StopPeriodDetected start (weekday)OfficialWeekend shift
Lapa StationAM06:1006:00+10 min
Salvador Bus StationPM17:0517:00+48 min
Lacerda ElevatorPM17:0617:00+80 min
Shopping mallPM15:5717:00+193 min
Castro Alves TheaterPM17:2117:00+89 min

Every day's detected start

One mark per day for the same five series. At every one of these stops the weekend peak starts later than the weekday peak, which is the real variation in this window. weekday weekend or holiday; a larger mark is several days at the same time

Per-day starts from the local run in outputs/boundary_points_real.csv; its day counts differ slightly from the Kaggle run in the table above.

Lapa Station AM, 62 days
Lapa Station, AM: detected daily peak start, 62 daysEach mark is one day's detected start of the AM peak at Lapa Station. Circles are weekdays, squares weekends and holidays; a larger mark is several days at the same time. The dashed line is the official 06:00.weekdayweekend05:0006:0007:00official 06:00
Salvador Bus Station PM, 53 days
Salvador Bus Station, PM: detected daily peak start, 53 daysEach mark is one day's detected start of the PM peak at Salvador Bus Station. Circles are weekdays, squares weekends and holidays; a larger mark is several days at the same time. The dashed line is the official 17:00.weekdayweekend16:0017:0018:0019:00official 17:00
Lacerda Elevator PM, 32 days
Lacerda Elevator, PM: detected daily peak start, 32 daysEach mark is one day's detected start of the PM peak at Lacerda Elevator. Circles are weekdays, squares weekends and holidays; a larger mark is several days at the same time. The dashed line is the official 17:00.weekdayweekend16:0017:0018:0019:00official 17:00
Shopping mall PM, 43 days
Shopping mall, PM: detected daily peak start, 43 daysEach mark is one day's detected start of the PM peak at Shopping mall. Circles are weekdays, squares weekends and holidays; a larger mark is several days at the same time. The dashed line is the official 17:00.weekdayweekend15:0016:0017:0018:0019:0020:0021:00official 17:00
Castro Alves Theater PM, 32 days
Castro Alves Theater, PM: detected daily peak start, 32 daysEach mark is one day's detected start of the PM peak at Castro Alves Theater. Circles are weekdays, squares weekends and holidays; a larger mark is several days at the same time. The dashed line is the official 17:00.weekdayweekend16:0017:0018:0019:0020:00official 17:00

Does anything drift? Not at the right granularity

CapyMOA ADWIN on the online regressor's error, per stop. Fed every 5-minute error, it alarms dozens of times because it tracks the daily demand cycle. Fed the per-day RMSE, it finds no drift day at any stop, which matches the boundary series.

From outputs/role_d_concept_drift.csv, the CapyMOA run.

ADWIN alarms per stop, per instance and per dayFor each stop, the number of ADWIN alarms on the model's per-instance error, next to the drift days ADWIN finds on the per-day RMSE series, which is zero for every stop.Lapa Station186 alarms, 0 drift daysSalvador Bus Station136 alarms, 0 drift daysLacerda Elevator119 alarms, 0 drift daysShopping mall126 alarms, 0 drift daysCastro Alves Theater58 alarms, 0 drift daysUFBA university141 alarms, 0 drift daysFerry Boat terminal57 alarms, 0 drift daysItapua Beach55 alarms, 0 drift days

The timetable's busiest time against demand

Weekday gap between the busiest scheduled arrival time in the GTFS timetable and the detected demand peak. Most demand peaks come later than the service peak.

From outputs/schedule_alignment.csv; demand peaks from the local run. Stops without enough demand to show a peak are left out.

Timetable peak against demand peak, weekdaysWeekday gap between the timetable's busiest arrival time and the detected demand peak, per stop and period. Positive bars mean demand peaks later than the timetable.UFBA university, AM+275 min (timetable 05:55, demand 10:30)UFBA university, PM+67 min (timetable 15:55, demand 17:01)Lapa Station, AM+19 min (timetable 05:50, demand 06:09)Lapa Station, PM+108 min (timetable 16:05, demand 17:52)Ferry terminal, AM+46 min (timetable 06:00, demand 06:46)Ferry terminal, PM+258 min (timetable 15:10, demand 19:27)Shopping mall, PM-22 min (timetable 16:20, demand 15:57)Castro Alves Theater, AM+51 min (timetable 06:30, demand 07:21)Castro Alves Theater, PM+126 min (timetable 15:15, demand 17:20)Salvador Bus Station, AM+35 min (timetable 05:45, demand 06:20)Salvador Bus Station, PM+31 min (timetable 16:35, demand 17:05)Lacerda Elevator, AM+63 min (timetable 06:25, demand 07:27)Lacerda Elevator, PM+96 min (timetable 15:30, demand 17:06)